I need to repeat a word using a loop

조회 수: 1 (최근 30일)
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.

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 3월 17일
편집: KALYAN ACHARJYA 2018년 3월 17일
for a=1:7
fprintf('\nHello'); %\n for new line
end
  댓글 수: 1
Thishan Dharshana Karandana Gamalathge
This is acceptable. However, at the end of last "Hello" the icon ">>" follows.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by