필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Problem with function

조회 수: 1 (최근 30일)
Paolo Della Vedova
Paolo Della Vedova 2011년 9월 29일
마감: MATLAB Answer Bot 2021년 8월 20일
HI Guys,
i have to solve the following equation with matlab (numerically) but i don´t get any solution...could you help me out??
50 = R*cos^2((pi*x)/l)
I have all the parameter and i just need to solve it for x...
Thanks
  댓글 수: 3
Paolo Della Vedova
Paolo Della Vedova 2011년 9월 30일
Hi, the code is the following:
syms x
equ = 50 - Rpiu*(cos((pi*x)/l)*cos((pi*x)/l));
y0 = solve (equ,x)
and it gives a strange result...
Walter Roberson
Walter Roberson 2011년 9월 30일
What strange result does it give?
Have you tried
simple(y0)
after the solve() ?

답변 (2개)

Ajay Kumar
Ajay Kumar 2011년 9월 29일
Matlab would not return the value of X if you do the following:
50=R*cos^2((pi*X)/I)
You can probably try:
%Assign values
R = 1; % Replace these values with desired value
I = 1;
X= (I/pi)*acos(sqrt(50/R))
This makes sure that the result you want is on the Left hand Side and all the variables on the right hand side are already initialized.

Walter Roberson
Walter Roberson 2011년 9월 29일
fzero(@(x) R*cos((pi*x)/l)^2 - 50, 0)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by