Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I cant get my code to pass all the pretest, what should i add to my code? Matlab code please. Fill in the given template
I cant get my code to pass all the pretest, what should i add to my code?
Matlab code please.
Fill in the given template to create a function nonpivotcols that takes a general mxn matrix as input and produces a matrix consisting of the nonpivot columns of the input matrix. Function 0 \begin{tabular}{l|l} 1 & function npc=nonpivotcols(A) \\ 2 & \\ 3 & {[R pcols ]=rref(A);} \\ 4 & A(:,pcols)=[]; \\ 5 & \\ 6 & {[r,fcols]=size(A);} \\ 7 & \\ 8 & npc=A(:,fcols); \\ 9 & end \end{tabular} Code to call your function ? Test on input zeros(4,6) (no pivot columns) (Pretest) Variable result must be of size [4 6]. It is currently of size [4 1 1]. Check where the variable is assigned a value. Test Code: \begin{tabular}{l|l} 1 & A= zeros (4,6); \\ 2 & result = nonpivotcols (A); \\ 3 & refresult = reference.nonpivotcols (A); \\ 4 & assessvariableEqual ('result', refresult); \end{tabular} Output: fols=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