1

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

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

EDIT

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

enter image description here

1
  • 1
    Can you show a screenshot of which param you are referring to? Also which MATLAB version are you using? Commented Feb 18, 2015 at 17:04

1 Answer 1

1

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

EDIT

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')
Sign up to request clarification or add additional context in comments.

2 Comments

I looked into that one, but that doesn't seem to be it. If I manually change Target Hardware from the GUI the TargetHWDeviceType value doesn't change. Sorry, I should have mentioned that in my question. I have also looked at ProdHWDeviceType, and that wasn't it either.
`ProdHWDeviceType' is the correct setting to use. I will update my answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.