Solve equation in matlab
5 ビュー (過去 30 日間)
古いコメントを表示
What is the matlab code to solve this equation?
cos(βL)cosh(βL)= -1 for L = 1,2,3,4
And, how to plot the result?
Thanks
0 件のコメント
採用された回答
Stephan
2020 年 9 月 2 日
% rewrite equation to be equal to zero for fsolve and save as a function handle
eqn = @(beta, L) cos(beta .* L) .* cosh(beta .* L) + 1;
% define values for L
L = 1:4;
% call fsolve
sol = fsolve(@(beta)eqn(beta,L),[1 1 1 1])
% test the quality of the result - all results should be near zero
test = eqn(sol,L)
% plot results
plot(L, sol)
xlabel('L')
ylabel('beta')
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Ordinary Differential Equations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!