use a loop structure .

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 日

0 投票

This can be done without a for loop
[m,n]=ndgrid(1:4);
A=m*10+n

この質問は閉じられています。

質問済み:

2016 年 8 月 29 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by