I am facing error while executing this code,pls help me to solve this issue
Mostrar comentarios más antiguos
A = [ 1 12 3 9 5
11 7 8 14 10
6 2 13 4 15]
C = zeros(size(A)) ;
[val,idx] = max(abs(A)) ;
for i = 1:size(A,3)
[val,idx] = max(abs(A(:,i)));
C(idx,i) = val
end
6 comentarios
Birdman
el 27 de Nov. de 2017
What do you want to do with the code?
Prabha Kumaresan
el 27 de Nov. de 2017
Birdman
el 27 de Nov. de 2017
Ok,but what do you want to see for idx instead of 2?
Prabha Kumaresan
el 27 de Nov. de 2017
Prabha Kumaresan
el 27 de Nov. de 2017
KSSV
el 27 de Nov. de 2017
Irrespective of what is size of A..it should be size(A,2)...red about size command in matlab.
Respuestas (1)
KSSV
el 27 de Nov. de 2017
0 votos
It should be run till size(A,2) not size(A,3)...note that your matrix A is 2D not 3D.
Categorías
Más información sobre Startup and Shutdown 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!