Solve equation in matlab

조회 수: 11 (최근 30일)
Angam Kamei
Angam Kamei 2020년 9월 2일
댓글: Angam Kamei 2020년 9월 2일
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

채택된 답변

Stephan
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')
  댓글 수: 1
Angam Kamei
Angam Kamei 2020년 9월 2일
Thanks Stephan

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by