Does anyone knows how to star pattern print trapeze ? like the example below
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
****
*****
******
*******
2 comentarios
Respuestas (1)
Image Analyst
el 19 de Jul. de 2020
So, do you know about fprintf()? You can simply call fprintf() 4 times to make those 4 lines.
3 comentarios
Image Analyst
el 19 de Jul. de 2020
So put fprintf() in a for loop
for k = smallNumber : bigNumber
fprintf(.............)
end
Hint:
>> str = repmat('*', [1, 8])
str =
'********'
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!