#Day92#100DaysChallenge- Matlab Loops | Steps Pattern-2
#Day92-Steps Pattern-2
Matlab code
function pattern_steps2(x)
inc=1;
space=1;
for i=1:1:x-1
for space=1:1:space
fprintf('\t');
end
for j=1:1:inc
fprintf('*');
end
inc=inc+1;
space=space+1;
fprintf('\n');
end
for i=1:1:x+1
for space=1:1:space
fprintf('\t');
end
for j=1:1:inc
fprintf('*');
end
inc=inc-1;
space=space-1;
fprintf('\n');
end
>> pattern_steps2(6)
*
**
***
****
*****
******
*****
****
***
**
*
Click here for video description
No comments