% clear SignalName DataType InitialValue StorageClass % %% 导入Simulink.AliasType % [~,~,AliasType_Cell] = xlsread(Excel_Name,'AliasType'); %导入AliasType工作表为单元数组 % for row = 2:size(AliasType_Cell,1) %从第2行开始循环处理每一行内容 % % 提取别名、基础类型 % AliasName = AliasType_Cell{row,1}; % BaseType = AliasType_Cell{row,2}; % if(~isnan(BaseType)) % % 在工作空间中建立该对象并配置其属性 % evalin('base',[AliasName,' = Simulink.AliasType;']); % evalin('base',[AliasName,'.BaseType = ''',BaseType,''';']); % end % end
时间: 2024-04-27 16:22:06 浏览: 155
这是一段 MATLAB 代码,主要是用来导入 Excel 表格中的 AliasType 工作表,并将其中别名和基础类型信息转换为 Simulink.AliasType 对象并配置其属性,最终存储在 MATLAB 工空间中。具体的实现过程是通过使用 xlsread 函数读取 Excel 表格中的数据,并存储为单元数组,然后通过循环遍历每一行数据,提取出别名和基础类型信息,再使用 evalin 函数在 MATLAB 工作空间中建立该对象并配置其属性。其中 ~ 表示忽略不需要的返回值。
阅读全文
相关推荐


















