Creating matrix with incremental values

 Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 2 de Jun. de 2019
Editada: KALYAN ACHARJYA el 2 de Jun. de 2019
using loops, you asked for.
mat1=[];
row_num=3; % Change the row number as per require
colm_num=3; % Change the col number as per require
count=0;
for i=1:row_num
for j=1:colm_num
count=count+1;
mat1(i,j)=count;
end
end
disp(mat1);

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 2 de Jun. de 2019

Editada:

el 2 de Jun. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by