I need to repeat a word using a loop

2 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by