getting error while trying to write a code to solve general case diagonal Ax=b matrix
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!