I am facing error while executing this code,pls help me to solve this issue
이전 댓글 표시
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
Birdman
2017년 11월 27일
What do you want to do with the code?
Prabha Kumaresan
2017년 11월 27일
Birdman
2017년 11월 27일
Ok,but what do you want to see for idx instead of 2?
Prabha Kumaresan
2017년 11월 27일
Prabha Kumaresan
2017년 11월 27일
KSSV
2017년 11월 27일
Irrespective of what is size of A..it should be size(A,2)...red about size command in matlab.
답변 (1개)
KSSV
2017년 11월 27일
0 개 추천
It should be run till size(A,2) not size(A,3)...note that your matrix A is 2D not 3D.
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!