Simulink Mask Control: File Explorer

Is it possible to create functionality like a "file explorer" control for a mask control? I'd like for my mask to bring up a file explorer window on a button press -- the selection from which gets dumped to a edit box.
At the moment, I can only use an edit box with no file explorer to specify a path.

 Respuesta aceptada

Pavan Guntha
Pavan Guntha el 22 de Oct. de 2021

1 voto

Hi Jordan,
The required functionality is illustrated by the following example. The step by step process is as follows:
1) While adding the Mask, we can add a Edit box and button to the Mask.
2) The properties of the Edit box are as follows:
3) The properties of the button are as follows:
The callback function is to be added as follows:
In the callback function, we are utilizing uigetfile to open up the File Explorer and there by extracting the file name and path name information and assigning to the Edit box using Simulink.Mask.get function.
The final mask looks as follows:
For more information you could look at the documentation pages of uigetfile and Simulink.Mask.get functions.
Hope this helps!

1 comentario

Jordie Yonathan Santoso
Jordie Yonathan Santoso el 25 de Mayo de 2022
Hi Pavan,
this is very helpful! I do have basically the same prpblem, but the difference is the file that i want to call is in .xlsx and with uigetfile I can't make that happen.
Can you help me with this?
Thank you

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Etiquetas

Preguntada:

el 21 de Sept. de 2021

Comentada:

el 25 de Mayo de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by