本文介绍了如何通过脚本在Simulink Embedded Coder中设置“目标硬件"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Simulink项目,其中包含许多子项目.我需要从Simulink生成代码的不同环境.因此,我试图通过MATLAB脚本设置目标硬件.我可以更改其他设置,但是我不知道目标硬件参数的名称,因此我可以使用set_param().我已经搜索过,但似乎找不到它,而且似乎没有.

I have a Simulink project with a lot of sub-projects. I have different environments for which I need to generate code from Simulink. So I am trying to set the Target Hardware from a MATLAB script. I can change other settings just fine, but I don't know how the name of the Target Hardware parameter so I can use set_param(). I have searched for it, but can't seem to find it and it appears that there isn't one.

models = {'Model1','Model2','Model2'};

for i=1:length(models)
    open(char(models(i)));
    set_param(char(models(i)),'TargetLang','C++');
    set_param(char(models(i)),'CodeInterfacePackaging','Nonreusable function')
    set_param(char(models(i)),'MaxIdLength','63')

    set_param(char(models(i)),'ZeroExternalMemoryAtStartup','off');
    set_param(char(models(i)),'Toolchain','Linaro Toolchain v4.8');
    save_system(char(models(i)));
end

有人知道如何通过MATLAB脚本设置目标硬件吗?不必设置为set_param.

Does anyone know how to set the Target Hardware from a MATLAB script? It doesn't have to be set_param.

编辑

我正在使用MATLAB 2014a,下面是一个屏幕截图.

I am using MATLAB 2014a and a screen shot is below.

推荐答案

TargetHWDeviceType 您要做什么?可以使用set_param进行设置.它似乎同时适用于设备供应商和设备类型.

Is TargetHWDeviceType what you are after? This can be set with set_param. It seems to apply to both Device Vendor and Device Type.

编辑

要使用的正确设置是 .例如,要将其设置为Freescale的MPC55xx,您需要执行以下操作:

The correct setting to use is ProdHWDeviceType. For example, to set it to an MPC55xx from Freescale, you need to do:

set_param(bdroot,'ProdHWDeviceType','Freescale->MPC55xx')

这篇关于如何通过脚本在Simulink Embedded Coder中设置“目标硬件"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 05:31