How to use the function uigetfile?

16 visualizaciones (últimos 30 días)
Shahar ben ezra
Shahar ben ezra el 13 de Jul. de 2021
Comentada: Shahar ben ezra el 14 de Jul. de 2021
When I use the uigetfile function
And want to select any file that is not in the same folder as my M file code
I'm getting an error
How can I select the file from any folder on my computer?

Respuesta aceptada

Walter Roberson
Walter Roberson el 13 de Jul. de 2021
[read_my_file, rmfdir] = uigetfile('*.xlsx')
if ~ischar(read_my_file); return; end %user cancel
rmfn = fullfile(rmfdir, read_my_file)
read_my_file_table = readtable(rmfn) ;

Más respuestas (1)

ANKUR KUMAR
ANKUR KUMAR el 13 de Jul. de 2021
Editada: ANKUR KUMAR el 13 de Jul. de 2021
"How can I select the file from any folder on my computer?"
This is pretty simple. You need to provide the full path of the file while calling uigetfile function.
uigetfile('D:\folder\subfolder\subsubfolder\*.xlsx')

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by