function Y = ForwardSub(L,b) % you forgot to assign the output in the function definition
Info
此问题已关闭。 请重新打开它进行编辑或回答。
Error: too many outputs
1 次查看(过去 30 天)
显示 更早的评论
function ForwardSub(L,b)
%Forward substitution method to compute Y= L/b
s = length(b); %no of coloumns
Y = zeros(s,1); %the answer Y is initialized to zero
Y(1) = b(1)/L(1,1); %the first diagonal entry
for j=2:s
Y(j)=b(j) - sum(L(j, 1:j-1)).*Y(1:j-1)/L(j,j); %solve for other elements of Y
end
end
0 个评论
回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!