In Matlab create a rref() function from scratch given the matrix A
`Hey,
Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc%clears screen
clear all%clears history
close all%closes all files
format long
clear all
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MAKES RANDOM MATRIX A
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m = 3;
A=randi([1,10],3,3);
BB=A;
[m,n] = size(A);
type='f';
tol=1e-5;
do_full = ~issparse(A) || strcmp(type,'f');
if do_full
% Loop over the entire matrix.
i = 1;
j = 1;
jb = [];
% t1 = clock;
while (i <= m) && (j <= n)
% Find value and index of largest element in the remainder of
column j.
[p,k] = max(abs(A(i:m,j))); k = k+i-1;
if (p <= tol)
% The column is negligible, zero it out.
A(i:m,j) = 0; %(faster for sparse) %zeros(m-i+1,1);
j = j + 1;
else
% Remember column index
jb = [jb j];
% Swap i-th and k-th rows.
A([i k],j:n) = A([k i],j:n);
% Divide the pivot row by the pivot element.
Ai = A(i,j:n)/A(i,j);
% Subtract multiples of the pivot row from all the other
rows.
A(:,j:n) = A(:,j:n) - A(:,j)*Ai;
A(i,j:n) = Ai;
i = i + 1;
j = j + 1;
end
end
else
% Non-pivoted Q-less QR decomposition computed by Matlab
actually
% produces the right structure (similar to rref) to identify
independent
% columns.
R = qr(A);
% i_dep = pivot columns = dependent variables
% = left-most non-zero column (if any) in each row
% indep_rows (binary vector) = non-zero rows of R
[indep_rows, i_dep] = max(R ~= 0, [], 2);
indep_rows = full(indep_rows); % probably more efficient
i_dep = i_dep(indep_rows);
i_indep = setdiff(1:n, i_dep);
% solve R(indep_rows, i_dep) x = R(indep_rows, i_indep)
% to eliminate all the i_dep columns
% (i.e. we want F(indep_rows, i_dep) = Identity)
F = sparse([],[],[], m, n);
F(indep_rows, i_indep) = R(indep_rows, i_dep) \ R(indep_rows,
i_indep);
F(indep_rows, i_dep) = speye(length(i_dep));
% result
A = F;
jb = i_dep;
end
disp('RREF is');
disp(A);

Kindly revert for any queries
Thanks.
For “Extract the column basis”, using the MATLAB functions rref and rank, make your own function file to find pivot columns of A from the result of rref(A). Do NOT use the syntax [R pivotcols] = rref(A), use only rref(A). You may use the MATLAB commands min and find.please follow the instructions!! please help me , I have to submit in 2 hours
In matlab, us the pseudo inverse function to create a linear fit from velocity-second matrix. Use the equation to project the speed when v=12 m/s. v [6 8 10] s [50 88 124]
In MATLAB: Without using a function, create a 6 by 6 matrix containing zeros in all entries except for the first row, first column, and main diagonal (which are random integers between 10 and 100).
what is a good matlab code to out put this matrix from
question 1 to 3
HITA 1)-The general form cf the quadratic equation is a +bx+c 0 Wrte a MATLAB function named quadratic that finds the two roots of this equation and x when given the coeficients a, b and c 2)-Create a random matrix A in MATLAB with 6 rows and 3 oolumns using the rand) function 3)-Now modify quadratic by so that il can take each row...
Question. Given the RREF augmented matrix below, write the solution to the associated system in parametric vector form. [1098 10 1 4 5 1 Answer: x =
(MATLAB): Suppose that you are given a positive definite symmetric matrix A, a vector b, and a real number c. Write MATLAB code which finds the minimum of the function f() r A bc subject to the constraint rT =1 for some vector r and real number . Note: This is a Lagrange Multi pliers problem It turns out that the Lagrange multiplier algebra is simply matrix algebra, which you can easily do in MATLAB. It may be a In...
I have created a function (lets call it function A) in MATLAB that uses 'for loop' to create a 3*4 matrix. I am creating another MATLAB function (lets call it function B) that has absolutely no relation with function A but needs to use the matrix from function A. How do I call only the matrix from function A to function B such that as this matrix changes in function A it triggers corresponding changes in function B as well?...
11. Create your own MATLAB function file using Power Method to find the largest eigenvalue. A matrix and an initial guess can be the inputs and the output should be the largest eigenvalue. Please send the file by email. 11. Create your own MATLAB function file using Power Method to find the largest eigenvalue. A matrix and an initial guess can be the inputs and the output should be the largest eigenvalue. Please send the file by email.
in matlab please
1. (44 points): Given the equations u, v, and w: create a function file that has u, v, and was outputs and for inputs b and t. Given that t is osts with At = and bis 10 < b < 30 with Ab = 1. Plot the results of u vs. v vs. w all on the same 3D plot. (Hint: Use a for loop to call the function file and have the outputs of the...
For each of the following matrices determine whether the matrix is in REF, in RREF or in neither RREF nor REF 0 2 -1 34 010 3 0 B- 00 2-5 0 A-0 0 0 0 0 000 0 1 0 0 0 2 1 0 1 0-4 0 D=100 C-1001 000 0 1 14-17 0 0-2 6 3 00 0 1 4 00 0 0 -3 0 0 1 G- 10 H=1000 0 0 1 J-0 0 1 A...