Borrar filtros
Borrar filtros

i am trying to open a text file in my gui but its showing just the file name since i am new to matlab kindly help

1 visualización (últimos 30 días)
[filename]=uigetfile({'*.txt'},'File Selector');
set(handles.edit2,'string',filename);

Respuestas (1)

Walter Roberson
Walter Roberson el 31 de Mayo de 2015
[filename, filepath]=uigetfile({'*.txt'},'File Selector');
fullname = fullfile(filepath,filename);
%now read it.
content = fileread(fullname); %one of many ways to read files
%and display the content
set(handles.edit2, 'string', content);

Categorías

Más información sobre Entering Commands en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by