Solve differential Equation for certain values of variable x

I have to find 4 values of z corresponding to x. After calculating differential equation how can I substitute x in the z(differential) equation? I have attached simplified code so that reader can understand.
x=[2 3 4 5];
syms x
z=diff(sin(x)-cos(x))

 채택된 답변

Birdman
Birdman 2018년 4월 15일
편집: Birdman 2018년 4월 15일
Try this:
syms x
z(x)=diff(sin(x)-cos(x))
xVal=[2 3 4 5];
zVal=z(xVal)
What you need to do is to define a symbolic function z(x) and basically pass numeric values to that function as above. Really simple.

댓글 수: 1

Thanks alot. it works. Sometimes I would make simple things complex.

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

추가 답변 (0개)

카테고리

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

제품

질문:

2018년 4월 15일

댓글:

2018년 4월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by