Question: I'm not sure which MATLAB command performs the same operation at this. could you please help? ExERCISE2 (3 points) Difficulty: Easy DESCRIPTION: In this exercise,

 I'm not sure which MATLAB command performs the same operation at

I'm not sure which MATLAB command performs the same operation at this. could you please help?

ExERCISE2 (3 points) Difficulty: Easy DESCRIPTION: In this exercise, you will create a function in the file in MATLAB (see Project0) using the given code, and run the function on the given matrices. The function (code) takes two matrices A and B as inputs and returns a single matrix C if the dimensions of A and B agree; otherwise it returns an empty matrix, C [] function C-trial (A, B) [m,pl-size (A) g,n ize (B) if pq C-zeros (m,n f r i=1 :n end C= [ ] ; E(:,1)-A#8 ( : , i); else disp ('The dimensions of A and B disagree') end end **Create the function trial in a file in MATLAB **Type the created function in the diary file ** Run the function c-trial (A, B) on the matrices given below to get the output C: (a) A-randi( 10,35), B=ones(3,5) (b) A-magic(4), B-ones(4,3) (c) A-magic(5), Bones(5) **Write a single MATLAB command that performs the same operation on matrices A and B as the function above. Execute it in your diary file on the given matrices. You may receive an error message from MATLAB if the dimensions of the matrices do not match - do not delete it from your diary file %Compare the outputs after executing the function and the single command and write a comment whether they match or not. 90 Write a comment on the form of the outputs for parts (b) and (c) (take into consideration the properties of the matrix magic)

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!