??? Error using ==> eq Matrix dimensions must agree

2 visualizaciones (últimos 30 días)
Giannakis Stoukas
Giannakis Stoukas el 15 de Abr. de 2015
Comentada: John D'Errico el 15 de Abr. de 2015
[row, column]=find(My_matrix== pnode); I try to use this command and i get this error
??? Error using ==> eq Matrix dimensions must agree
What should i do?How i should write the syntaxis of it?
  3 comentarios
Giannakis Stoukas
Giannakis Stoukas el 15 de Abr. de 2015
pnode is a variable and it has a value and the matrix has dimensions 10X14,this is why it is weird
Giannakis Stoukas
Giannakis Stoukas el 15 de Abr. de 2015
Actually the previous orders are min_cost = min(x(:)); [pnode, node] = find(x == min_cost); [row, column]=find(My_matrix == pnode); [rows, columns]=find(My_matrix==node);
and the min_cost instead of taking one value it takes an array

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 15 de Abr. de 2015
Editada: John D'Errico el 15 de Abr. de 2015
Your matrices are not compatible in size. READ THE ERROR MESSAGE!
Try this:
whos MY_matrix pnode
What does it tell you?
  3 comentarios
Giannakis Stoukas
Giannakis Stoukas el 15 de Abr. de 2015
Editada: John D'Errico el 15 de Abr. de 2015
Actually the previous orders are
min_cost = min(x(:));
[pnode, node] = find(x == min_cost);
[row, column]=find(My_matrix == pnode);
[rows, columns]=find(My_matrix==node);
and the min_cost instead of taking one value it takes an array
John D'Errico
John D'Errico el 15 de Abr. de 2015
I see that the last line has
find(My_matrix==node);
Even if pnode is a scalar, node may well not be so, since it was created from a previous call to find.

Iniciar sesión para comentar.

Categorías

Más información sobre Data Distribution Plots 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