필터 지우기
필터 지우기

I don't know how to code this number triangle

조회 수: 2 (최근 30일)
Ye
Ye 2022년 10월 29일
답변: KSSV 2022년 10월 29일
How to Code this following number triangle below??

채택된 답변

KSSV
KSSV 2022년 10월 29일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by