Filter löschen
Filter löschen

I need to repeat a word using a loop

1 Ansicht (letzte 30 Tage)
I want to say "Hello" seven times. How can I do it using MATLAB? I know how to do it using numbers but not using words.
Thanks.

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 17 Mär. 2018
Bearbeitet: KALYAN ACHARJYA am 17 Mär. 2018
for a=1:7
fprintf('\nHello'); %\n for new line
end
  1 Kommentar
Thishan Dharshana Karandana Gamalathge
This is acceptable. However, at the end of last "Hello" the icon ">>" follows.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by