Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

use a loop structure .

조회 수: 1 (최근 30일)
Aurelio Gonzalez
Aurelio Gonzalez 2016년 8월 29일
마감: MATLAB Answer Bot 2021년 8월 20일
A=zeros(4) % this is the same as zeros (4,4) // returns as a 4x4 matrix of zeros
for m= 1:4
for n=1:4
A(m,n) = m*10+n
end
end
  댓글 수: 1
Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 29일
What is your problem?

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2016년 8월 29일
This can be done without a for loop
[m,n]=ndgrid(1:4);
A=m*10+n

Community Treasure Hunt

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

Start Hunting!

Translated by