Indexed Assignment on the Right Side
Mostrar comentarios más antiguos
I am calling function f(x) that returns a matrix of 100 columns.
All what I need is just the 10th column. So I need one vector from the whole returned matrix.
I need to get rid of 99 columns and retain only the 10th column.
In Julia, this can be done by:
columnTen = f(x)[:,10]
I am dying to do the same thing in MATLAB.
Not sure why this simple operation seems impossible.
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 17 de Nov. de 2020
Y = f(x);
columnTen = Y(:,10);
1 comentario
Sinan Islam
el 17 de Nov. de 2020
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!