Does anyone knows how to star pattern print trapeze ? like the example below
2 views (last 30 days)
Show older comments
****
*****
******
*******
2 Comments
Answers (1)
Image Analyst
on 19 Jul 2020
So, do you know about fprintf()? You can simply call fprintf() 4 times to make those 4 lines.
3 Comments
Image Analyst
on 19 Jul 2020
So put fprintf() in a for loop
for k = smallNumber : bigNumber
fprintf(.............)
end
Hint:
>> str = repmat('*', [1, 8])
str =
'********'
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!