Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

select a row from a matrix and a vector simultanesouly

1 visualización (últimos 30 días)
Niki
Niki el 30 de Ag. de 2011
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
For example we have >> X=rand(100,5); >> Y=rand(100,1); Then I would like to put out the first row of X and the first row of Y simultaneously It is like LOO, but it should be mentioned that if we remove the first row of X we should remove the first row of Y as well, and it should be done for all rows
do you have any idea?

Respuestas (1)

Paulo Silva
Paulo Silva el 31 de Ag. de 2011
for r=1:100 %row to remove or whatever you want to do
X=rand(100,5);
Y=rand(100,1);
%show the r row on the workspace
X(r,:)
Y(r,:)
%remove the r row
X(r,:)=[];
Y(r,:)=[];
end

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by