I to create a function using besselj function and solve it using fzero to find eigenvalues like this...

t = 1:.01:30;
x = t;
y = besselj(1,t);
t = 1:.01:30;
b = 10;
y2 = besselj(0,t);
x0=[0 30];
fun = t.*y - b.*y2 ;
z = fzero(fun, x0)

댓글 수: 1

Whe I try to put this code at the MatLab it shows this message: Error using fzero (line 169) FUN must be a function, a valid string expression, or an inline function object.
Error in Try6 (line 9) z = fzero(fun, x0)

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

 채택된 답변

Symbolically you seem to be trying to solve
t * BesselJ(1,t) - 10 * BesselJ(0,t)
probably for t. If that is the case, then code
fzero(@(t) t .* besselj(1,t) - 10 * besselj(0,t), x0)
Note: there are 10 zeros between 0 and 30, and fzero does not promise to find the first. It might refuse to find any because the expression is negative at both 0 and 30 and so fzero would not know that there is a zero crossing.

댓글 수: 5

Thanks a lot for your help, but do you know how to show the ten first values using this equation?
I mean...I am looking for the first ten values that solve this equation. Symbolically I want to find the eigenvalues....that are found using that equation...
I discovered that this function just gets one value per interval...do you know if I can get through ten different answers?
Thanks a lot!! But I also used this code: a = 0:30; for x0 = 1:length(a) t = 1:.01:10; z = x0; z = fzero(@(t) t .* besselj(1,t) - 10 * besselj(0,t), x0) end
with the above code I found all the values that I want. But some values show up more than once. Do you know how to do it to they show up only once?

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

추가 답변 (0개)

카테고리

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

태그

질문:

N/A
2015년 6월 3일

댓글:

N/A
2015년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by