Question: 2) Write a function with no input argument and two output arguments. This function will keep prompting the user to input a string, then

2) Write a function with no input argument and two output arguments. This function will keep prompting the function [n, arr] = user_input n = 1; string = input('Enter the string:', 's'); while (string ==

2) Write a function with no input argument and two output arguments. This function will keep prompting the user to input a string, then stores them in a cell array, until the user hits the return key without inputting a string (i.e. the input() function returns empty). This function will then return the resulting cell array as the first output argument, the number of strings as the second output argument. function [n, arr] = user_input n = 1; string=input('Enter the string:', 's'); while (string == "") == false arr{n} = string; n = n+1; string=input('Enter string:', 's'); end n = n-1; end 2) Write a function with no input argument and two output arguments. This function will keep prompting the user to input a string, then stores them in a cell array, until the user hits the return key without inputting a string (i.e. the input() function returns empty). This function will then return the resulting cell array as the first output argument, the number of strings as the second output argument. function [n, arr] = user_input n = 1; string=input('Enter the string:', 's'); while (string == "") == false arr{n} = string; n = n+1; string = input('Enter string:', 's'); end n = n-1; end

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

It looks like there are a couple of syntax errors and logical issues in your c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!