Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

use a loop structure .

2 visualizaciones (últimos 30 días)
Aurelio Gonzalez
Aurelio Gonzalez el 29 de Ag. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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 comentario
Azzi Abdelmalek
Azzi Abdelmalek el 29 de Ag. de 2016
What is your problem?

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 29 de Ag. de 2016
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