Question
The aim of this assignment is to gain familiarity with functions in MATLAB. The following test script (test.m) should be written, where this calls the
The aim of this assignment is to gain familiarity with functions in MATLAB. The following test script (test.m) should be written, where this calls the function Conversions(), written in Conversions.mclear;rng(100);m = randi([1,10],5,5);[diag, sum_r, sum_c] = Conversions();ans1 = diag(m);ans2 = sum_r(m);ans3 = sum_c(m);Thefunction Conversions() returns function handles for the followingthree functions:diag,which returns thediagonal of a square matrixsum_r, which sums all therows into a new matrix columnsum_c, which sums all the columns into a new row.Here are theoutputs that should be generated.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started