Info

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

how to merge the matrices in one matrice?

1 visualización (últimos 30 días)
Ararat Cetinkaya
Ararat Cetinkaya el 8 de Mzo. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
I want to merge class matrix in one matrix in for loop but it gives error like Unrecognized function or variable 'allclass'.
for d =1:3 ;
class(:,1:3) = [num(num(:,3)==d,1:3)];
allclass= [allclass ; class];
end
  1 comentario
David Hill
David Hill el 8 de Mzo. de 2020
An example with your data would be helpful. Look at reshape() function.

Respuestas (1)

Chidvi Modala
Chidvi Modala el 11 de Mzo. de 2020
"Unrecognized function or variable 'allclass'" error may occur because allclass variable is not initialized before using it. So, you can initialize "allclass" variable with an empty array. You can make use of the following example
num = [3 2 1;2 2 2; 1 2 3];
allclass = [];
for d =1:3 ;
temp = num(num(:,3)==d,1:3);
allclass= [allclass ; temp];
end

La pregunta está cerrada.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by