MATLAB Answers

use a loop structure .

1 view (last 30 days)
Aurelio Gonzalez
Aurelio Gonzalez on 29 Aug 2016
Answered: Azzi Abdelmalek on 29 Aug 2016
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 Comment

Azzi Abdelmalek
Azzi Abdelmalek on 29 Aug 2016
What is your problem?

Sign in to comment.

Answers (1)

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

  0 Comments

Sign in to comment.

Sign in to answer this question.