Input Arguments of Type Double

This is my function
function[x] = fixedpt(xin,tol)
xold=xin;x=g(xin),
while abs(x-xold)>tol,xold=x;x=g(xold), end
end
When I try to use it I get the error
Undefined function 'g' for input arguments of type 'double'.
Error in fixedpt (line 2)
xold=xin;x=g(xin),
How can I fix this?

답변 (2개)

Matt J
Matt J 2013년 5월 8일

0 개 추천

You need to define g (a function? a vector?) so that MATLAB knows what it is.

댓글 수: 2

Matt J
Matt J 2013년 5월 8일
Jamie Commented:
All I know is that it is a .m file, the code was written by my lecturer and I was just supposed to be using it, I have no idea how the code works.
We were told to download it to matlab then plug in our numbers.
Matt J
Matt J 2013년 5월 8일
편집: Matt J 2013년 5월 8일
Take the code to your lecturer, then. We have no way of knowing where "g" is supposed to come from if it's not defined in the mfile itself. Possibly you were meant to download that, too.

댓글을 달려면 로그인하십시오.

Jamie
Jamie 2013년 5월 8일
편집: Matt J 2013년 5월 8일

0 개 추천

Relocated to Comment by Matt J

카테고리

도움말 센터File Exchange에서 Downloads에 대해 자세히 알아보기

태그

질문:

2013년 5월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by