Effacer les filtres
Effacer les filtres

I need to repeat a word using a loop

1 vue (au cours des 30 derniers jours)
Thishan Dharshana Karandana Gamalathge
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.

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by