Borrar filtros
Borrar filtros

convert specific vector to vector in one direction

1 visualización (últimos 30 días)
muhammad ismat
muhammad ismat el 19 de Feb. de 2016
Respondida: muhammad ismat el 19 de Feb. de 2016
if i have av=[1 2;3 4;2 1;4 3] and i want the result a=[1 2;3 4]

Respuestas (3)

James Tursa
James Tursa el 19 de Feb. de 2016
Editada: James Tursa el 19 de Feb. de 2016
a = av(1:2,1:2);
If this simple solution is not what you are looking for then please give more details in your question.
Based on your reply it looks like you simply want the top half of your matrix. So try this:
[m n] = size(av);
a = av(1:(m/2),:);

muhammad ismat
muhammad ismat el 19 de Feb. de 2016
i have a vector as av=[1 2;5 6;7 8;4 3;9 8;6 7;2 1;6 5;8 7;3 4;8 9;7 6] i want to a=[1 2;5 6;7 8;4 3;9 8;6 7]

muhammad ismat
muhammad ismat el 19 de Feb. de 2016
that's right , thank you very much

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by