exmple
a=[0,0,1,2,3,4,0,0]
which gives me positition 3, value 1 and position 6, value 4
Thanks!!
No products are associated with this question.
Is this a homework question?
You are looking for a method to find the first and last element different from zero. Fortunately Matlab's find command can solve this directly. Therefore I assume, you did not search in the documentation already. While reading the Getting Started chapters is a good idea in general, you could search directly also:
docsearch find
Or ask Google about "Matlab find first non-zero".
0 Comments