Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Selecting Elements of an Array in Simulinks Based on Simulation Time
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I am creating a simulation of a quarter car model which I wish to disturb with a displacement of the wheel. I have imagined a speedbump whose equation behaves roughly as follows:
%y = -4.444x^2 + 1.333x
%dy = -8.888x + 1.333
In a for loop I have placed values from these equations into two arrays and I wish to have my model run in such a way that it selects a new element as an input every so often. I tried to figure out how to do using the selector block, but I cannot seem to get a grasp on what input it requires to make a selection.
0 件のコメント
回答 (1 件)
Raj
2019 年 5 月 17 日
編集済み: Raj
2019 年 5 月 17 日
Since you have not shared your model, its difficult to give a precise answer. I assume you must be using user defined matlab function block in your model. Save your data (obtained from the two equations) in workspace as a time series in steps of your model simulation step time. Then you can can pass these two parameters as an input to the function using inports. Make sure you set the configuration parameter under Data Import/Export correctly. Now there is no need for the 'for' loop as data corresponding to each step time only will be used by the function as simulation progresses. I have tried to make sense but if it sounds confusing then get back and share your model along with data.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!