TargetLink函数解密之-自建GUI修改Block定标信息

TargetLink函数解密之-自建GUI修改Block定标信息

之前介绍过get_tlcg_data, set_tlcg_data, dsdd之SelectObject,今日就使用一个简单的例子来,结合这三个函数来实现修改block的变量标定。

1.建立GUI在建立GUI之前,如果还不会怎么建立GUI的话,执行脑补一下。

新建GUI添加按钮2.设置回调函数设置Variable的回调函数 callback

12345678910111213% --- Executes on button press in tl_variable.function tl_variable_Callback(hObject, eventdata, handles)% hObject handle to tl_variable (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)tlcg_data = get_tlcg_data(gcbh);output = tlcg_data.output;[currentPath,bModified] = dsdd('SelectObject','CurrentPath',output.variable ,'objectKind','Variable');if bModified == 1 output.variable = currentPath; tlcg_data.output = output; set_tlcg_data(gcbh, tlcg_data);end3.结果演示选中一个Block,此处选中了Gain模块 点击Variable按钮 #### 选中变量 #### 确定查看效果

相关文章

银行放款后多久到账?影响到账时间的3个关键因素 365约彩app怎么没有了

银行放款后多久到账?影响到账时间的3个关键因素

📅 10-10 👁️ 3110
传奇里哪些怪物是魔法攻击 365bet中文体育在线

传奇里哪些怪物是魔法攻击

📅 01-15 👁️ 225