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.

 Accepted Answer

for a=1:7
fprintf('\nHello'); %\n for new line
end

1 Comment

This is acceptable. However, at the end of last "Hello" the icon ">>" follows.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!