How to initialize a bus with a unit delay block?
2 次查看(过去 30 天)
显示 更早的评论
I'm trying to initialize a bus from a unit delay block. I have created the following bus:
![bus_def.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/243201/bus_def.png)
and defined a structure in the base workspace with the following code:
clear state
state = struct;
state.JulianDate = 2458773.91667;
state.Position = [6547.177196; 1754.310842; 0] * 1e3;
state.Velocity = [-1.744249; 6.509626; 3.659120] * 1e3;
state.Orientation = [0; 0; 0; 1];
state.AngularVelocity = [0; 0; 0];
If I use this structure for the "Initial condition" parameter of the unit delay block in the following model
![model.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/243202/model.png)
where State In and State Out are explicitly set to be "Data Type: Bus: State", I get the following error:
![error.PNG](https://www.mathworks.com/matlabcentral/answers/uploaded_files/243203/error.png)
I've followed the instructions on this page: https://www.mathworks.com/help/simulink/ug/specifying-initial-conditions-for-bus-signals.html but apparently I didn't get it right. What am I missing ?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Event Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!