help-octave
[Top][All Lists]
Advanced

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

Placing 'end' (index) in a variable


From: Carnë Draug
Subject: Placing 'end' (index) in a variable
Date: Tue, 27 Apr 2010 15:06:16 -0400

Hi

I'm trying to place the keyword end (as used in indexes) in a variable but I don't know. The reason I'm trying to do this is to have a condition first that if true, the following graphs should use the specified data interval, otherwise, they should show the whole time interval. here's the code example:


start = 1
if (interval)
 final = input;
else
 final = end;
endif

plot( timestamps(start:final), data(start:final) );

I could place the plot inside the if blocks, but this was only to exemplify. In my real case, the start and final variables will actually affect the next 30 lines. probably the solution will pass by not placing the end in a variable, and do it in some other way but I can't see it now.

Thanks in advance for any help,

Carnë Draug

reply via email to

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