I don't know how to code this number triangle
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
How to Code this following number triangle below??
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1173073/image.png)
0 Kommentare
Akzeptierte Antwort
KSSV
am 29 Okt. 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
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!