フィルターのクリア

Calculate previous and current values from signal builder

2 ビュー (過去 30 日間)
siti khadijah
siti khadijah 2017 年 4 月 27 日
コメント済み: siti khadijah 2017 年 5 月 8 日
Hai guys,
I need your advice as well as help. I use signal builder as an input the matlab function in simulink, and I used the matlab function to calculate the inverse kinematics of my system. The problem now is, I need to calculate difference of the previous and current values from the inverse kinematics.
For instance, 3 values are sent from signal builder : 0, 30 and 70. These values will be recalculated in the inverse kinematics and I set them as 'theta'. And the next thing that I want to do is to calculate : 30 - 0 = 30; 70 - 30 = 40;
But I dont have any idea to do that since the input is in signal builder. Hope any of you could helps or advice me on this matter. Thanks
-CT_

採用された回答

Fei Deng
Fei Deng 2017 年 5 月 1 日
There are two ways to do it.
1. In the MATLAB function block you write:
function y = fcn(u1,u2)
y = u1-u2;
feed the signal from "signal builder" to u1 (input of MATLAB function block), and delay the signal by "Unit delay" block and feed it to u2.
2. if you are only doing subtraction in the MATLAB function, you can use a sum block(+-) instead. feed the signal into "+", and delay it with a "unit delay" and feed it into "-".
note that the step size of your solver need to be adjusted to the time difference for data [0, 30, 70,..]
  1 件のコメント
siti khadijah
siti khadijah 2017 年 5 月 8 日
Hai Fei Deng,
Apologizes for responding late. I was away. Thanks for your help :). I'll try this ;)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by