using Matlab to solve this gume user ipie ui a lunction that doeso ents, but in
ID: 3586327 • Letter: U
Question
using Matlab to solve this
Explanation / Answer
function outstr = stringprompt()
disp('When prompted, enter a string of any length.');
n=0;
while n==0%loop runs until string with at least one char is entered
outstr = input('Enter the string here: ','s');
n=length(outstr)
end
end
output:
When prompted, enter a string of any length.
Enter the string here:
n =
0
Enter the string here:
n =
0
Enter the string here: hello
n =
5
ans =
hello
>>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.