help-octave
[Top][All Lists]
Advanced

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

Re: Placing 'end' (index) in a variable


From: James Sherman Jr.
Subject: Re: Placing 'end' (index) in a variable
Date: Tue, 27 Apr 2010 15:22:30 -0400

The quickest/easiest solution is that if the length of the all the sequences are the same, just make final = length(timestamps).

If not, then I'd need a bit more info about the format of the data to figure out something more elegant.

2010/4/27 Carnë Draug <carandraug.ml@gmail.com>
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

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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