It says Fzero isn't a function (SUPER SIMPLE CODE)
이전 댓글 표시
S=3*sin(Y)+Y-2;
L=sqrt(1+S.^2);
quiver(T, Y, 1./L, S./L, 0.5);
axis tight
xlabel 't'
ylabel 'y'
title ('DF dy/dt = 3sin(y)+y-2)')
u=fzero(S,.5);
q=fzero(S,4);
My problem is that I'm getting an error with fzero @ the last two lines, but clearly S is a function. I looked through the fzero help table and couldn't figure out why Matlab doesn't see S a a function
댓글 수: 1
Adam
2017년 2월 24일
What you created is just a variable that evaluates a function in-place, not a function itself.
답변 (1개)
Torsten
2017년 2월 24일
0 개 추천
S=@(Y) 3*sin(Y)+Y-2;
Best wishes
Torsten.
카테고리
도움말 센터 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!