In MATLAB, please answer correctly. Thank you!
Posted: Tue Jul 12, 2022 8:22 am
In MATLAB, please answer correctly. Thank you!
FA2.3.1 Examining Loopings Examine the following for statements and determine how many times does each loop will be executed. 1. for ii = -32768:32767 2. for ii = 32768:32767 Script 3. for kk = 2:4:3 4. for jj = ones(5,5) 1% Variables 2 % count1 for counting loop number 1 3 % count2 for counting loop number 2 4 % count3 for counting loop number 3 5% count4 --- for counting loop number 4. 6% Set your counters to its inital value 7 8 10% Loop Code Counters 12 13 14 15 16 17 18 19 20 21 23 % Display Loop Counts 24 disp(strcat('Number 1 looped for(', int2str(count1), ') times')) 25 disp(strcat('Number 2 looped for(', int2str (count2), ) times')) 26 disp(strcat('Number 3 looped for(', int2str (count3), ') times')) 27 disp(strcat('Number 4 looped for(', int2str (count4), ') times')) 28 Save C Reset My Solutions > MATLAB Documentation
FA2.3.1 Examining Loopings Examine the following for statements and determine how many times does each loop will be executed. 1. for ii = -32768:32767 2. for ii = 32768:32767 Script 3. for kk = 2:4:3 4. for jj = ones(5,5) 1% Variables 2 % count1 for counting loop number 1 3 % count2 for counting loop number 2 4 % count3 for counting loop number 3 5% count4 --- for counting loop number 4. 6% Set your counters to its inital value 7 8 10% Loop Code Counters 12 13 14 15 16 17 18 19 20 21 23 % Display Loop Counts 24 disp(strcat('Number 1 looped for(', int2str(count1), ') times')) 25 disp(strcat('Number 2 looped for(', int2str (count2), ) times')) 26 disp(strcat('Number 3 looped for(', int2str (count3), ') times')) 27 disp(strcat('Number 4 looped for(', int2str (count4), ') times')) 28 Save C Reset My Solutions > MATLAB Documentation