Question: How would I approach this MATLAB problem? It clearly states that no arrays are to be used. How would I multiply two arrays using for

 How would I approach this MATLAB problem? It clearly states that

How would I approach this MATLAB problem? It clearly states that no arrays are to be used. How would I multiply two arrays using for loops?

Thank you.

1. Write a MatLab function that will multiply 2 matrices A of (size n rows by m columns) and B (size nm rows by n columns) to produce the matrix C. You must do this using 'for loops' and scalar multiplication only. The solution using the full power of MatLab is trivial C A*B. The first line of the function file must be function [C,n,m,err]-my-matrix, mult(A,B) [err-0 if function executes properly, err=1 if not] Your function should check that A and B are of the proper dimensions. Use tic/toc to compare the speed of your function with Matlab matrix multiplication for a 100x100 matrix and a 1000x1000 matrix Use sparse() to multiple 2 square matrices of order 10,000 (10,000x10,000) for which all the elements of each are zero except the mail diagonal, the first upper diagonal and the first lower diagonal. Find and use a built-in MatLab function to determine how many of the elements in these 2 matrices are non-zero. What percentage is this? Do the same for the product. a. b. Write a Matlab function that creates a histogram of the number of occurrences of each of the digits 0-9 in the number (ignore the decimal point). The first line of the function file must be 2. function [number,N]-make_hist(s) where 's' is the number represented as a character string. The output should be 'number, a scalar with the numerical value of the number to machine precision, and 'N' , the number of digits in s. Run your function on char(vpa(pi,100000)), char(vpa(exp(1),100000)) and char(vpa(sqrt(2),100000)). Email the function and your histogram (as a .jpg file) to me by the due date

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!