I want to put the solution under each question I want the Matlab Program in orde
ID: 3758221 • Letter: I
Question
I want to put the solution under each question I want the Matlab Program in order to test by myself and I can edit it. Write the "rowcolnum." function as discussed in class. Below is the beginning, of the function [you may copy/paste this part]. Use vector and matrix operations. DO NOT USE LOOPS. Check that the input values (r and c) are legal (integers and GE 1] and if they are not legal print an error message and return an empty vector. Demonstrate that it works by testing it using the following five cases (for some cases you may choose exact values, but keep both r and c less than 10]: r=c=1, r=1,c>1, (c) r>1,c=1, (d) r>2,c>2, and (e] an illegal input. Function X = rowcolnum(r,c) %X = rowcolnum 9r,c) % create a matrix with r rows and c columns containing values 10*row+col %e.g. X=rowcolumn(2,3] results inX=[11 12 13 ; 21 22 23] % this is useful for demonstrating matrix row and column manipulations % if r or c is larger than 9 this is not particularly useful Read section 10.1 of the text then write an anonymous function named "Rpar" to compute the equivalent resistance of several resistors in parallel. The function argument is a row or column vector containing the resistor values. The function return value is the equivalent resistance. Demonstrate that it works by testing it using the following four cases: xl=Rpar(3), x2=Rpar([10 15]) x3=Rpar([10;20;25]), and x4=Rpar([9 9 9 9 9]).Explanation / Answer
elseif r>2 && c>2
X = [10*1+1: 10*r+c];
else
X = "Illegal";
end
end
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.