Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR MATLAB

print hello world n times in matlab

n = input('Enter a number:');
for sentence = 1:n  % have the indexing go from 1 to n, not reverse
    fprintf('%d. Hello world!
', sentence); % print the index, and a newline 

end
 
PREVIOUS NEXT
Tagged: #print #world #times #matlab
ADD COMMENT
Topic
Name
9+9 =