フィルターのクリア

evaluate bessel with plot

2 ビュー (過去 30 日間)
zamri
zamri 2012 年 7 月 4 日
Hi, i wonder if anyone can help on why i receive this error "??? Error using ==> plot Vectors must be the same lengths"
I want to plot a function of combination of differentiation of bessel.
m=0; k=0; omega=0:0.02:10;
a = besselj(m,omega);
da = diff(a);
b = bessely(k,omega);
db = diff(b);
c = besselj(m,omega);
dc = diff(c);
d = bessely(k,omega);
dd = diff(d);
g=da.*dd-dc.*db;
plot(omega,g);
hold all;
plot(omega,0,'k');
axis([min(omega) max(omega) -100 100]);
thanks so much

採用された回答

Walter Roberson
Walter Roberson 2012 年 7 月 4 日
Your arguments to the the bessel functions are numeric, so you are using the numeric bessel functions and getting numeric answers. diff() applied to a numeric vector is the difference function (not differentiation) and results in a vector that is one shorter than the original. You then attempt to plot the original-length omega vector against the one-shorter difference vector.

その他の回答 (1 件)

カテゴリ

Help Center および File ExchangeBessel functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by