getting error while trying to write a code to solve general case diagonal Ax=b matrix
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!