Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

use a loop structure .

1 Ansicht (letzte 30 Tage)
Aurelio Gonzalez
Aurelio Gonzalez am 29 Aug. 2016
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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 Kommentar
Azzi Abdelmalek
Azzi Abdelmalek am 29 Aug. 2016
What is your problem?

Antworten (1)

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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by