Hi,
I am trying to plot an equation with two variales but setting one variable as a constant for the plot.
Here is the code i have tried so far:
syms w sol(t)
sol(t) = (1/(400-w^2)) * (sin(w*t) - (w/20)*sin(20*t))
for w=5:10
fplot(sol(t))
hold on
end
hold off
Here is something else I have tried with a simplied version of the problem:
syms y(x) a
y(x) = a*x
a = 1
fplot(y(x))
OR
syms y(x) a
y(x) = a*x
assume(a==1)
fplot(y(x))
Thanks in advance for any help you can give.

 채택된 답변

Patrick Haffmans
Patrick Haffmans 2021년 2월 19일

0 개 추천

The function you want to use is
subs(s,old,new)
Check out how to use it here

댓글 수: 1

Thank you patrick.
clear
syms y(x) a
y(x) = a*x
fplot(subs(y,a,3))

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

질문:

2021년 2월 19일

댓글:

2021년 2월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by