MATLAB Answers

how to create a matrix from another

1 view (last 30 days)
Kalpha.mc
Kalpha.mc on 20 Sep 2020
Answered: Bruno Luong on 20 Sep 2020
How would i create a matrix that is the last column and the 2nd and 4th row of matrix x?

  0 Comments

Sign in to comment.

Answers (2)

Ameer Hamza
Ameer Hamza on 20 Sep 2020
Edited: Ameer Hamza on 20 Sep 2020
M = x(:, [end 2 4])
This is pretty basic stuff in MATLAB and you have other similar questions too. I ssuggest you to read about array indexing: https://www.mathworks.com/help/matlab/math/array-indexing.html.

  0 Comments

Sign in to comment.


Bruno Luong
Bruno Luong on 20 Sep 2020
x([2 4], end)

  0 Comments

Sign in to comment.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!