App designer error-Error using indexing Dot indexing is not supported for variables of this type.

7 次查看(过去 30 天)
I am now using app designer to create an GUI to simulate my simulink file. Here is my code:
I want to export the Editfield.value to the block in my simulink file as below:
And finally display the outcome of simulink to my app designer.
Here is my problem:
(1)I cannot figure out what kind of the error in my first picture is.
(2)How can I export my value in text Editfield to simulink as well? The type of array seems to be not the same as single variable.

回答(1 个)

Brahmadev
Brahmadev 2023-9-25
Hi Chiang,
I understand that you would like to use read Parameters from a masked block from Simulink in AppDesigner. You can use the following code to get the values of different parameters from the "Vehicle Body 1DOF Longitudinal" block mask.
% Button pushed function: Button
function goPushed(app, event)
MaskHandle = Simulink.Mask.get('testing_mask_parameters/Vehicle Body 1DOF Longitudinal');
disp(MaskHandle.Parameters.Value);
end
This will give you the Parameters as a comma seperated list.
You can refer to the following documentation “Control Masks Programmatically” for more information:
Hope this helps!
Best Regards,
Brahmadev

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by