필터 지우기
필터 지우기

Number Pattern Square Table

조회 수: 1 (최근 30일)
Larissa Monjaraz
Larissa Monjaraz 2021년 2월 19일
편집: Larissa Monjaraz 2021년 2월 19일
I need help on program where I need to write a number pattern in a square table. I already have some of the code done, but I kind of need an extra push to finish it.
The user would enter in a number and then their would be a pattern height based on that number.
Example: 4
1234
2234
3334
4444
Here's my code so far: (I don't know where to go from here)
clc,clear;
PH=input('Enter the height of the pattern: ');
N = 1;
for ii = 1:PH
for jj = N:PH
fprintf('%g', jj);
end
fprintf('\n');
N = N +1;
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by