MATLAB on ramp, section 5.2, further practice.
6 views (last 30 days)
Show older comments
Muhammad Mustafa Pardesi
on 27 May 2020
Edited: Juan Manuel Bayona Arenas
on 8 Sep 2020
How can I access non-consecutive indices in a row vector? For e.g elements 1,3 and 6 in a column vector of 7x1
0 Comments
Accepted Answer
Ameer Hamza
on 27 May 2020
Read this: https://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matlab.html. For example
x = [1 2 3 4 5 6 7].'; % 7x1 vector
y = x([1 3 6]);
1 Comment
Juan Manuel Bayona Arenas
on 8 Sep 2020
Edited: Juan Manuel Bayona Arenas
on 8 Sep 2020
THX. So. in Matlab 2020 not is raw vector. It´s a column vector. In this case, y = x([1;3;6]); 5.
More Answers (0)
See Also
Categories
Find more on Matrix Indexing 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!