Question: Matlab only please Nested for loops allow a programmer to modify conditions inside a for loop, and can be very powerful. The nested for loop

 Matlab only please Nested for loops allow a programmer to modify

Matlab only please

Nested for loops allow a programmer to modify conditions inside a for loop, and can be very powerful. The nested for loop looks like the following: for ctrl - start1:3topi, do some stuff for ctr2 - start2:stop2 do some more stuff end # do yet more stuff end Your task: Create a function file with one input, N, that produces three outputs: 1) A vector of squares, from 1 to NP (i.e. [1 4 9 16 ....)) If I call the function from the command window by pressing LastName_FirstInitial_ME3500_Activity5 (4), the first output will be: 1 4 9 16 2) The second output will be a multiplication table showing a numerical row and column labels in the first row and the first column respectively. Also, the output will show a multiplication label (x) in the first position. For example, if you entered N = 3, it would produce: x 1 2 3 1 1 2 3 2 2 4 6 3 3 6 9 3) The third output will be a scalar value that sums the values of the multiplication tables. Again, for N = 3, the value would be 36. To create these files, you must use for loops or nested for loops, basic arithmetic (+-x=), and the command "num2str" to display x

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!