am trying to figure out my control loop time in simulink for controlling my simulation using MATLAB 2021a.\
% The rate control may not be effective if the simulation model is too % complex to be handled at the desired rate. To check the rate control % performance, consider output rateObj.LastPeriod. Ideally it should be % close to SampleTime during most part of the simulation.
How do I actually output/access the rateObj.LastPeriod in the model so I can make a historgram of the control rate?
ANSWER
Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.
function r = stepImpl(obj) %stepImpl Regulates simulation update if coder.target('MATLAB') obj.RateObj.waitfor(); r = obj.RateObj.LastPeriod; else r = nan; end end
Save the ExampleHelperSimulationRateControl.m class and re-open the model.
Comments
Post a Comment