필터 지우기
필터 지우기

Mathematica FindRoot to Matlab

조회 수: 2 (최근 30일)
Tsuwei Tan
Tsuwei Tan 2019년 5월 3일
답변: Walter Roberson 2019년 5월 3일
May I ask how to put the following Mathematica code into Matlab?
mvel1[n_, H_, f_] := v /. FindRoot[freq[v, n, H, 2.2, 1800, 1500] f, {v, 1500.1, 1799.9}]
I need to create a function like
funciton mvel1=mvel1_fun(n,H,f)
...
end
The Matlab freq function is
function freq=freq_fun(v,n,H,m,cb,cw)
dum1=sqrt(cw^(-2)-v^(-2));
dum2=sqrt((cw^(-2)-v^(-2))/(v^(-2)-cb^(-2)));
freq=1/(2*pi*H*dum1)*(pi*n-atan(m*dum2));
end
Thank you!

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 3일
mvel1 = @(n, H, f) fzero(@(v) freq_fun(v, n, H, 2.2, 1800, 1500) - f, [1500.1, 1799.9]) ;

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by