MATLAB only. Computer science, do not change subject
This is matlab question. Give me a working code for cramers rule
the function must accept and AUGMENTED matrix and then solve
if the function you give will not accept augmented matrix i will badly dislike it
Answer only correctly.
take test cases to find output and match
`Hey,
Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.
clc
clear all
close all
format long
Aug=randi([1,10],3,4)
func(Aug)
function x=func(Aug)
x=[];
A=Aug(:,1:end-1);
b=Aug(:,end);
D=[];
for i=1:size(A,2)
D=[A(:,1:i-1) b A(:,i+1:end)];
x(i,1)=det(D)/det(A);
end
end
Kindly revert for any queries
Thanks.
Get Answers For Free
Most questions answered within 1 hours.