Clear Filters
Clear Filters

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

2 views (last 30 days)
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.

Answers (1)

Walter Roberson
Walter Roberson on 10 Apr 2016
Edited: Walter Roberson on 14 Apr 2016
u should be the data values read in at real time.
Are you trying to create a symbolic transfer function?
  2 Comments
wilson hoo
wilson hoo on 11 Apr 2016
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!