How to select specific elements of a matrix and save them in another matrix?
4 views (last 30 days)
Show older comments
Let's say I have matrix A=[1; 2 ;3; 6; 7 ;8 ;11 ;12 ;13]
I need a script which goes through matrix A one by one and defines the elements which A(k+1)-A(k)>1
then I need that elements to be saved in matrix B
so B=[6; 11]
0 Comments
Answers (1)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!