help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Same script for octave/matlab


From: Ketil Froyn
Subject: Same script for octave/matlab
Date: Thu, 7 Oct 1999 20:26:49 +0200 (MET DST)

Hi.
I use octave at home and matlab at my university. What I would like to
know is if I can somehow differentiate between matlab and octave from a .m
file, eg:

------
x=0:0.1:2*pi;
y=sin(x);

if (THIS_IS_MATLAB)
  plot(x,y);
  print output.eps;
elseif (THIS_IS_OCTAVE)
  gset terminal postscript eps
  gset output "output.eps"
  plot(x,y);
  gset terminal x11
  gset output
endif
------

This also brings me on to another question. Is there some way I can check
what terminal and output are, so that they can be changed back correctly?

And finally, (and probably most importantly), has someone made a function
like print for octave? Is it possible to take whatever is in the gnuplot
window and output that to a postscript file without calling plot again?

Sorry if all this is old stuff, but I couldn't find a search function for
the archive. I looked through some of the 1999 archive, but didn't find
anything.

--
Ketil Froyn                             The probability of someone
University of Oslo                      watching you is proportional
Norway                                  to the stupidity of your action.



---------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.  To ensure
that development continues, see www.che.wisc.edu/octave/giftform.html
Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html
---------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]