Borrar filtros
Borrar filtros

Command Line Simscape Model Generation - Powergui Error

5 visualizaciones (últimos 30 días)
Callum Hoare
Callum Hoare el 12 de Feb. de 2019
Respondida: Naman Bhaia el 25 de Feb. de 2019
Hi,
I'm trying to build a Simscape model programmatically from a script file. The model seems to build correctly until I add the "powergui" element. When the power gui is added or interacted with it throws an error popup with the following:
" Error evaluating 'Mask Dialog' callback of PSB option menu block block (mask) 'XXX/powergui'. Callback string is 'powergui ('Simulation Type', [],[],gcb);'
Index in position 1 exceeds array bounds (must not exceed 1"
This occurs even only when using a 'Half-Bridge Converter' and the powergui block. It does not matter whether I add the powergui through the command line or via the library selection. It also affects other Simscape models that I have loaded. The only work around I've found is to use a `clear all` which seems to stop the error. Given it applies across the models, I imagine its not a problem with powergui initialisation. Perhaps there is a simulation setting which I've missed that needs to be set for the callback to execute? Does anyone have information on this error?
Thanks!

Respuestas (1)

Naman Bhaia
Naman Bhaia el 25 de Feb. de 2019
Hey Callum,
Since this error is very specific, it will need reproduction of the entire model or at least a subpart of it to really understand where it is going wrong. Without that, the only possible work-arounds I can suggest are
  1. You can check if there is another file named as ‘powergui.*’ in your current MATLAB workspace/folder. If any are found, please rename them. This is done because the model is taking higher preference in the MATLAB path and shadows the "powergui" block file. When you add a "powergui" block in any Simulink model, Simulink is trying to open your "powergui.slx" model instead of the "powergui" block and reports an error. After renaming, try to run the following command in MATLAB command line:
>> restoredefaultpath
2. Some corrupted MATLAB preferences could be a possible cause of this issue. To resolve this, please regenerate you MATLAB preferences directory using the instructions given in the below link:

Categorías

Más información sobre Troubleshooting en Help Center y File Exchange.

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by