give arbitrary, unknown and in-real-time input value to transfer function

2 次查看(过去 30 天)
Hi,
I am writing a control system program and I have a function to get an input value from external hardware. This value need to be operated by my transfer function in real time and then I can get a output value. Here is the problem, I dont know the input value beforehand. There is a function close, lsim . But the input argument u of the function lsim request an exact matrix which is confirmed and known beforehand. All I can do is collecting the input values, but I dont know the next. So, how can i do to accomplish? Is there any matlab function I can use to solve this problem? Help me please! I have been annoyed for many days!
Millions of thanks.
April 11, 2016
I have a stupid and rude idea taday. To collect the input value in an array. Then it is operated by function lsim. I will get the final value of the output array as my output value, and give it to my external hardware.But I think this is not efficient.
I have a stupid idea again. When I collect the input value to the array, I delete the earliest value from the array and keep this array short. And then use lsim to get the final value as output value.
But I think there is a simple and smart way to accomplish it. I need your help.
Or is there someone who can amend lsimplot.m or lsim.m for my problem? Thanks so much.
I found something, Simulink® Real-Time™. It seems that simulink can probably solve my problem. But I dont want to use simulink now if possible.

回答(1 个)

Walter Roberson
Walter Roberson 2016-4-10
编辑:Walter Roberson 2016-4-14
u should be the data values read in at real time.
Are you trying to create a symbolic transfer function?
  2 个评论
wilson hoo
wilson hoo 2016-4-11
You mean get the inverse Laplace transform of the symbolic transfer function by matlab? The function ilaplace is only used in MuPAD. I have thought about it but not tried yet.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by