Borrar filtros
Borrar filtros

When using Protecting Referenced Models on Simulink models can you have random parameters?

1 visualización (últimos 30 días)
I basically need to have a State Space block that will have random numbers when run. And, it also needs to be protected.
If I use the rand(1) function in one of the state space parameters, Simulink will work the way I expect it to. But, once I protect the model, it will no longer be random.
I also tried using the Robust Control Toolbox with the uncertain state space to create random parameters. But, once I protect the model, the parameters are no longer random.
Is there any way to protect a Simulink model and have random parameters?
Thanks for the help.

Respuestas (1)

Ryan G
Ryan G el 29 de Jun. de 2012
Use a mask to set the parameters in the state space. This way you change the parameters for the state space on the mask instead of directly in the state space. This should do the trick.
  2 comentarios
Dan
Dan el 29 de Jun. de 2012
I'm not really sure on how to use masks. And I tried using setparam to change parameters on the protected model, but that didn't seem to work either. Maybe I'm doing something wrong.
Instead, I just looked up an S-Function to mimic the State-Space block. I can use the S-Function block and then just pcode the matlab file that runs the S-function. In the matlab file, I can use the rand(1) function and it does what I need to do. If you think this method has any obvious flaws, let me know.
Ryan G
Ryan G el 29 de Jun. de 2012
You can re-create a state space via s-function. I personally think that just makes the process a bit more tedious and difficult than it needs to be.
If you found a suitable workaround and you find masking to confusing then I would stick with that as explaining masks beyond that document would be pretty tough.

Iniciar sesión para comentar.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by