getting error while trying to write a code to solve general case diagonal Ax=b matrix
Show older comments
I am trying to write code for solve Ax=b
function [x]=solveDiag(A,b,n)
%A = nxn diagonal matrix
%b=1x3 column vector
%n=number of unknowns in diagonal
for i=1,2,...,n do
x(i)=b(i)/A(i,i);
fprintf('%d',x(i,:))
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!