simulink

Input data to Simulink from workspace

半城伤御伤魂 提交于 2019-11-28 04:33:46
问题 Hello anyone does know? I have data(myData) from matlab workspace. And in matlab simulink I have to do control system with regulator.First how to put data(myData) to simulink model input,and I want to show in graph two value(myData and regulator). 回答1: You can use the From Workspace block to read the data( lets say simin ) from the worspace. The variable simin should a structure with following fields: signals : values : A column vector representing data. Description : A string describing the

Efficient colon operator for multiple start and end points

家住魔仙堡 提交于 2019-11-28 00:12:11
Suppose I have the following two variables: start_idx = [1 4 7]; end_idx = [2 6 15]; I want to efficiently (no for loop if possible) generate a single row which consists of the colon operator being applied between corresponding elements of start_idx and end_idx . For this example, this would result in: result = [1:2 4:6 7:15]; Therefore: results = [1 2 4 5 6 7 8 9 10 11 12 13 14 15]; The method to do this should be usable inside Simulink's MATLAB Function block. Thank you very much! Here's a vectorized approach based on cumulative summation - % Get lengths of each group lens = end_idx - start

「SImulink调试错误」Invalid object id.Component: Simulink | Category: Model error

我的未来我决定 提交于 2019-11-27 07:29:42
1.问题描述 在另一台电脑上运行SImulink仿真时,报出如下错误: Invalid object id.Component: Simulink | Category: Model error 2.错误原因 从一个版本的Matlab软件制作,到另一个版本Matlab运行出现的fun函数不可用问题。 3.解决方法 新建一个fun函数,替换掉原来的fun函数,问题即可解决。 ×亲测有效 来源: https://blog.csdn.net/Robot_Starscream/article/details/97521000