Getting error message ' Index in position 1 exceeds array bounds ( must not exceed 4), error in line 7.

조회 수: 1 (최근 30일)
A= 5*5 size matrix
for m=1:5;
for n=1:5;
line 7-> E= A(m,n);
disp (E).

채택된 답변

Awais Saeed
Awais Saeed 2021년 8월 21일
You are storing only one element in E. Perhaps you want to copy elements of A into E element by element.
A = magic(5)
for m=1:1:size(A,1)
for n=1:1:size(A,2)
E(m,n)= A(m,n);
end
end
disp(E)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by