Using set_param on parameter 'ProdHWDeviceType'
Afficher commentaires plus anciens
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?
Réponses (1)
Kaustubha Govind
le 23 Août 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)')
Catégories
En savoir plus sur Programmatic Model Editing dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!