Why do i get "Too many output arguments" when i try to multiply my function?

조회 수: 1 (최근 30일)
My function is
function integralCO02(t)
(2/sqrt(pi))*exp(-t^2)
end
and when I try
2*integralCO02(5)
the error message 'Too many output arguments.' comes up.
The same happens for
anyconstante = integralCO02(5)

채택된 답변

Star Strider
Star Strider 2019년 12월 14일
You did not create an output when you declared your function.
Try this slightly modified version of your function:
function result = integralCO02(t)
result = (2/sqrt(pi))*exp(-t^2);
end
The call to it:
anyconstante = integralCO02(5)
now produces:
anyconstante =
1.567086653101734e-11

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by