how to create an discrete equation

조회 수: 27 (최근 30일)
Seungil Oh
Seungil Oh 2020년 8월 5일
답변: Surya Talluri 2020년 8월 10일
my question is how to creat discrete equations, calculate them and put the created discrete equations in each other such that i get an final diskrete equation
For example:
I. y_1(k) = a*y_1(k-1)+b*x_1(k-1)
II. y_2(k) = c*y_2(k-1) + d*y_1(k-1)
Final equation: y_2(k) = c*y_2(k-1) + d*a*y_1(k-2) + d*b*x_1(k-2)
** The values of x_1, i can get from the data set x_1 and for k = 1, y_1(k-1) = 0
** I would like to realize it into "sym".
thank you in advance
  댓글 수: 1
Rik
Rik 2020년 8월 5일
What have you tried so far?

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

답변 (1개)

Surya Talluri
Surya Talluri 2020년 8월 10일
I understand that you want to create discrete functions using Symbolic Math Toolbox. You can implement it by creating symbolic functions x_1(k), y_1(k), y_2(k)
syms a b c d x_1(k) y_1(k) y_2(k)
y_1(k) = a*y_1(k-1)+b*x_1(k-1);
y_2(k) = c*y_2(k-1) + d*y_1(k-1);
y_2(k)
ans =
c*y_2(k - 1) + d*(a*y_1(k - 2) + b*x_1(k - 2))
For replacing x_1 values, you can use “subs” function.
You can refer to following documentation for further understanding:

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by