필터 지우기
필터 지우기

How can i display a funtion dependenet to x ?

조회 수: 1 (최근 30일)
Mallouli Marwa
Mallouli Marwa 2017년 1월 21일
댓글: Star Strider 2017년 1월 23일
Hi How can i can i display f with values in function of x ?
L=3;
sol(1)=2;
psi=1;
f (x) = @(x) cos ( (sol(1)/L) *x)- cosh( (sol(1)/L) *x)+ psi *( sin( (sol(1)/L) *x)- sinh( (sol(1)/L) *x));

채택된 답변

Star Strider
Star Strider 2017년 1월 21일
This works:
L=3;
sol(1)=2;
psi=1;
f = @(x) cos ( (sol(1)/L) *x)- cosh( (sol(1)/L) *x)+ psi *( sin( (sol(1)/L) *x)- sinh( (sol(1)/L) *x));
x = linspace(-10, 10);
figure(1)
plot(x, f(x))
grid
xlabel('x')
ylabel('f(x)')
See the documentation for the linspace function to understand how to change the limits and number of elements in the ‘x’ vector.
  댓글 수: 5
Torsten
Torsten 2017년 1월 23일
Then I only see the "pencil and paper" solution.
Best wishes
Torsten.
Star Strider
Star Strider 2017년 1월 23일
Thank you, Torsten. I’m UTC-7 here. I appreciate your comments.
A numeric evaluation of df(x)/dx would be the gradient function.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Visualization and Data Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by