Borrar filtros
Borrar filtros

I don't know how to code this number triangle

2 visualizaciones (últimos 30 días)
Ye
Ye el 29 de Oct. de 2022
Respondida: KSSV el 29 de Oct. de 2022
How to Code this following number triangle below??

Respuesta aceptada

KSSV
KSSV el 29 de Oct. de 2022
n = [1 11 111 1111 11111 111111 1111111];
for i = 1 : length(n)
x = num2str(n(i)^2);
s = [blanks(length(n)-i) x];
fprintf('%s\n',s)
end
1 121 12321 1234321 123454321 12345654321 1234567654321

Más respuestas (0)

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by