MATLAB: Determining number of inputs input hello. usually in matlab, we ask the user to enter a value once using this code x=input('message'). but what if we wanted the user to determine how many times to enter a value? Best Answer N = ('How many times?'); for i=1:N a(i) = ('your input'); end Related SolutionsMATLAB: How to use for loop user_input = fprintf('%.1f\n', input('Enter a positive real number\n'));for i = 1:9 %first input outside the loop;so 9 more inputs if user_input >= 0 user_input = fprintf('%.1f\n', input('Enter a positive real number\n')); endend MATLAB: How to take a user input and use that in an equation units_opts = {'milliseconds', 'seconds', 'fortnights'};units_ms_scale = [1 1000 14*24*60*60*1000];n = menu('Time units:', units_opts);if n < 1; return; end %user canceluser_entered_time = input( sprintf('Enter the time, in %s', units_opts{n}) );user_time_ms = user_entered_time * units_ms_scale(n); Related QuestionDetermine ExpressionHow to determine number of workersBest way to determine if number is triangular number
Best Answer