f = inline('sin(x/2)')
g = @(y) 2*cos(y)

댓글 수: 3

Rik
Rik 2019년 1월 12일
My two questions are:
  1. Why are you using an inline function?
  2. What have you tried yourself?
f = inline('sin(x/2)')
g = @(y) 2*cos(y)
x = 0:0.1:2*pi
y1 = sin(x/2)
y2 = 2*(cos(x))
[AX,L1,L2] = plotyy(x,y1,x,y2)
Walter Roberson
Walter Roberson 2019년 1월 14일
your f and g assignment are not being used.

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

답변 (1개)

madhan ravi
madhan ravi 2019년 1월 13일

0 개 추천

syms x y
fplot(sin(x/2))
hold on
fplot(2*cos(y))
help fplot

댓글 수: 2

Shraddha Pandey
Shraddha Pandey 2019년 1월 14일
what is syms
madhan ravi
madhan ravi 2019년 1월 14일
Looks like you solved the problem by your comment above? Did you read the documentation of fplot?? It belongs to symbolic math toolbox used to define variables symbolically.

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

질문:

2019년 1월 12일

댓글:

2019년 1월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by