Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 1 to 4 Homework #6 Applied Programming, ENGR 10573 Spring 2018 Due Monday, Mar. 19 uploaded through TCU Online by 11:59 PM. Upload one

image text in transcribed

Problem 1 to 4

Homework #6 Applied Programming, ENGR 10573 Spring 2018 Due Monday, Mar. 19 uploaded through TCU Online by 11:59 PM. Upload one function, function lastname_howmework6() in a single m-file that runs each problem along with all of the subfunctions that work that particular problem When lastname_homework6 is typed into the command window, the homework problems should run sequentially showing plots and the proof that each subfunction works correctly. There should be NO input from the keyboard. The single M-file that you turn in is the code that will be graded. DO NOT vectorize your code. There will be a loss of 20 points for not following these directions exactl I. Create a 100,000-element vector filled with Gaussian random numbers using the command. x = randn (100000, 1) ;, Implement a statistics function, [mux, sx1, sx2] = calculate-statistics (x) using for-loops that returns the mean and both standard deviations. Display the results. You should get approximately [0,1,1] 2. Using the 100,000-element vector from problem #1, plot the histogram of the data using the [n, v] = hist (x, nbins) command for values nbins of 20, 40 and 100. Do not use the histogram (x,nbins) function. Plot the histograms in different colors on the same graph and display and comment on the results. (HINT: Use this function in the future) 3. Create a 3x5 matrix A full of random real-values and a 5x2 matrix B full of random, real-values. Implement a matrix multiplication routine in a function, c matrix mult (A, B) using for-loops. Make the routine's matrices sizes generic. Calculate the matrix C- AB and display the matrices. 4. Implement a matrix/vector multiplication routine in a function called, y matrix-vector-mult (A, x) using only for-loops (there should be only 2 loops used). Make the routine's matrices sizes generic so it will work with a matrix of any size. Create a 5-element column vector x full of random real-values and a 3x5 matrix A full of random real-values. Calculate the matrix y Ax and display the vectors and the matrices

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions