MATLAB Answers

Error: too many outputs

1 view (last 30 days)
Shelby Schreckenberg
Shelby Schreckenberg on 25 Feb 2020
Answered: madhan ravi on 25 Feb 2020
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 Comments

Sign in to comment.

Answers (1)

madhan ravi
madhan ravi on 25 Feb 2020
function Y = ForwardSub(L,b) % you forgot to assign the output in the function definition

  0 Comments

Sign in to comment.

Sign in to answer this question.


Translated by