[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using eval with multiple variable strings
From: |
Jaroslav Hajek |
Subject: |
Re: using eval with multiple variable strings |
Date: |
Sun, 31 Jan 2010 06:39:37 +0100 |
On Sun, Jan 31, 2010 at 6:21 AM, Thomas Detman <address@hidden> wrote:
> Hi,
>
> I'm starting to feel comfortable with octave, but have never used Matlab,
> although I always heard good things about it. I can't help with the eval
> command, but here is what I do to save a plot:
>
> #...
> Run = "103a" # just a dummy id tag for this example
> #...
> # your plot code here
> #...
> FigId = ["UtsVNT.",Run,".eps"]
> printf ('print (FigId,"-landscape", "-color")\n')
>
> At this point I check the plot in the plot window, and I should see this in
> the terminal window:
>
> FigId = UtsVNT.103a.eps
> print (FigId,"-landscape", "-color")
>
> If I like what I see, then I just copy and paste that last last line,
> right there in the terminal window.
>
> That's a little more complicated than it needs to be; one could just
> put the bare print statement in the code, like:
>
> print (FigId,"-landscape", "-color")
>
> But then the plot file get created whether you like it or not.
>
What about something like
if (yes_or_no ("save the plot?"))
print (FigId,"-landscape", "-color")
endif
--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz