필터 지우기
필터 지우기

Simulink Mask Control: File Explorer

조회 수: 6 (최근 30일)
Jordan McBain
Jordan McBain 2021년 9월 21일
댓글: Jordie Yonathan Santoso 2022년 5월 25일
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.

채택된 답변

Pavan Guntha
Pavan Guntha 2021년 10월 22일
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
Jordie Yonathan Santoso
Jordie Yonathan Santoso 2022년 5월 25일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Model Editing에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by