Matrix indexing - Picking columns
Mostrar comentarios más antiguos
So I trying to give an output a matrix which contains every fifth column of input (A). Below is what my current script look like.
function B = Script30( A )
B = A(:,1:5:end);
end
5 comentarios
Birdman
el 15 de Abr. de 2018
So, question?
bondpen
el 15 de Abr. de 2018
Guillaume
el 15 de Abr. de 2018
Important difference: your code is not a script but a function. It's begging for confusion to name a function script***.
Your function already returns every fifth column of the matrix, starting at column 1, so it's not clear what problem you're having
Jan
el 16 de Abr. de 2018
What give you rows? The shown code extracts columns.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices 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!