当前位置:网站首页>【小技巧】使用matlab GUI以对话框模式读取文件
【小技巧】使用matlab GUI以对话框模式读取文件
2022-07-02 03:38:00 【fpga和matlab】
在MATLAB 界面设计过程中,经常需要通过按键来调用读取文件的对话框,具体可以通过如下的代码来实现:
[filename,pathname]=uigetfile({'*.jpg','样本文件(*.jpg)';'*,*','所有文件(*.*)'},'请选择一个样本文件');
if isequal(filename,0)||isequal(pathname,0)
return;
end
FileName_AVI = [pathname,filename];此时,运行GUI界面,可以弹出如下的对话框:

可以看到,对话框中提示jpg格式的文件,如果改为其他的,也可以做相似的文件,如txt文件,如下所示:
[filename,pathname]=uigetfile({'*.txt','样本文件(*.txt)';'*,*','所有文件(*.*)'},'请选择一个样本文件');
if isequal(filename,0)||isequal(pathname,0)
return;
end
FileName_AVI = [pathname,filename];此时,运行GUI界面,可以弹出如下的对话框:

运行之后,文件的路径将保存到变量FileName_AVI中,然后做读取就可以了。
边栏推荐
- Discrimination between sap Hana, s/4hana and SAP BTP
- [C Advanced] brother Peng takes you to play with strings and memory functions
- What is the binding path of SAP ui5
- 蓝桥杯单片机省赛第十二届第二场
- MySQL advanced (Advanced) SQL statement (II)
- 蓝桥杯单片机省赛第七届
- 近段时间天气暴热,所以采集北上广深去年天气数据,制作可视化图看下
- Retrofit's callback hell is really vulnerable in kotlin synergy mode
- "Analysis of 43 cases of MATLAB neural network": Chapter 41 implementation of customized neural network -- personalized modeling and Simulation of neural network
- Network connection mode of QT
猜你喜欢

The first game of the 12th Blue Bridge Cup single chip microcomputer provincial competition

Pointer array & array pointer

In wechat applet, the externally introduced JS is used in xwml for judgment and calculation

Fourier series

Gradle foundation | customize the plug-in and upload it to jitpack

Kubernetes cluster storageclass persistent storage resource core concept and use

It took me only 3 months to jump out of the comfort zone and become an automated test engineer for 5 years
![[golang] leetcode intermediate bracket generation & Full Permutation](/img/93/ca38d97c721ccba2505052ef917788.jpg)
[golang] leetcode intermediate bracket generation & Full Permutation

Get started with Aurora 8b/10b IP core in one day (5) -- learn from the official routine of framing interface

蓝桥杯单片机省赛第十届
随机推荐
Account management of MySQL
Halcon image rectification
[untitled] basic operation of raspberry pie (2)
Global and Chinese market of gynaecological health training manikin 2022-2028: Research Report on technology, participants, trends, market size and share
[HCIA continuous update] overview of dynamic routing protocol
Pointer array & array pointer
What is the logical structure of database file
PY3, PIP appears when installing the library, warning: ignoring invalid distribution -ip
Introduction to Robotics II. Forward kinematics, MDH method
The 8th Blue Bridge Cup single chip microcomputer provincial competition
Analyse de 43 cas de réseaux neuronaux MATLAB: Chapitre 42 opérations parallèles et réseaux neuronaux - - opérations parallèles de réseaux neuronaux basées sur CPU / GPU
Grpc quick practice
Detailed explanation of ThreadLocal
KL divergence is a valuable article
Which of PMP and software has the highest gold content?
Unity脚本的基础语法(8)-协同程序与销毁方法
MD5 of Oracle
蓝桥杯单片机省赛第九届
ThreadLocal详解
Global and Chinese markets for ultrasonic probe disinfection systems 2022-2028: Research Report on technology, participants, trends, market size and share