Help write function in Matlab Test Cases: >> B = [1 2 3 4 5;6 7 8 9 10;11 12 13
ID: 3665537 • Letter: H
Question
Help write function in Matlab
Test Cases:
>> B = [1 2 3 4 5;6 7 8 9 10;11 12 13 14 15] B = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
>> myColumnRemover(B, 3)
ans = 1 2 4 5 6 7 9 10 11 12 14 15
>> myColumnRemover(B, 33)
ans = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Write a function with the header function [A] - myColumnRemover (A, colID) which removes a column (colID) from matrix A and returns matrix A. If matrix A was nxm originally, it will now be nx(m-1). If colID is greater than the number of columns, the function should return A as is. If A only has one column and colID is 1, the function should return an empty matrix, [].Explanation / Answer
my ColumnRemover(A,colID) for i = 1:length(A(:,1)) for j = 1:length(A(1,:)) linalg::delCol(A, colID) fprintf([repmat('%f ', 1, size(A, 2)) ' '], A'); >> A = magic(5)
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.