Mask editor problem.

9 visualizaciones (últimos 30 días)
Badr Taleb
Badr Taleb el 3 de Jun. de 2018
Comentada: Badr Taleb el 4 de Jun. de 2018
Pleas how can i creat a variable in mask that can be calculated from other two variables from the same mask like x=a+b, i tried to use the instruction ' * set_param('model/block','variable','a+b');*' in the Initialization, but no result appear in the mask, pleas how can i make this variable automaticly updated working?
  2 comentarios
TAB
TAB el 4 de Jun. de 2018
Do you want to create a temporary variable ? Or a mask parameters ?
Badr Taleb
Badr Taleb el 4 de Jun. de 2018
no i'm trying to creat a mask parameter.

Iniciar sesión para comentar.

Respuesta aceptada

TAB
TAB el 4 de Jun. de 2018
In Mask Initialization function
aVal = str2double(get_param(gcbh, 'a')); % a is existing mask parameter
bVal = str2double(get_param(gcbh, 'b')); % b is existing mask parameter
set_param(gcbh, 'c', num2str(aVal+bVal)); %c is existing mask parameter
  1 comentario
Badr Taleb
Badr Taleb el 4 de Jun. de 2018
thank you for your help. it's working

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by