how to obtain the last index of a column vector containg a set of given values?
Ältere Kommentare anzeigen
I have a column vector which shows time. I'm trying to find out the index using the find command. My input command was. >> s=find(time==0.1000); >> s
s =
Empty matrix: 0-by-1
The vector contains three values of 0.1000.I want the index of the last value. But it shows the above error message.
Antworten (1)
Image Analyst
am 15 Feb. 2014
0 Stimmen
The index of the last element of "time" or of any 1-D array is "end" or length(time).
3 Kommentare
Image Analyst
am 15 Feb. 2014
See the FAQ: http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F to see why you don't want to compare to 0.1 but need to check within a tolerance of 0.1.
Abin Krishnan
am 15 Feb. 2014
Image Analyst
am 15 Feb. 2014
Make it easy for us to help you. Read this. http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer As of now, I can't do anything to help you.
Kategorien
Mehr zu Matrix Indexing finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!