Using set_param on parameter 'ProdHWDeviceType'

I need to use set_param on parameter 'ProdHWDeviceType' but it just doesn't work. I've tried it on other parameters and it works. Below is the code that doesn't work and the code that works.
WORKS: set_param(modelNames{i}, 'InlineParams', 'on') set_param(modelNames{i}, 'ArrayBoundsChecking', 'none') set_param(modelNames{i}, 'ModelReferenceNumInstancesAllowed', 'single')
DOESN'T WORK: set_param(modelNames(i), 'ProdHWDeviceType', 'Generic->Unspecified (assume 32-bit Generic)')
error: Invalid Simulink object specifier
From the documentation, 'Generic->Unspecified (assume 32-bit Generic)' is the string that needs to be fed in for the default values. But it just doesn't work. Bug in MATLAB?

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 23 de Ag. de 2012
I think it's because you have a typo while indexing into the cell array modelNames. Instead of using modelNames{i}, you are using modelNames(i) - curly bracket vs. parentheses.
Try:
>> set_param(modelNames{i}, 'ProdHWDeviceType', 'Generic->Unspecified (assume 32-bit Generic)')

Categorías

Productos

Etiquetas

Preguntada:

el 23 de Ag. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by