I want to make my program interactive

1 次查看(过去 30 天)
tusu
tusu 2012-12-18
Hiee
I have a program which starts with agiven file name as a input...
my code starts with
txt-data = fileread('F:\data.txt'); ................. .......... ......
I want that when I run my program it should ask for the path for the file name or the file itself...and any user has to give that,,how can i do that without not changing the path name in program every time

回答(1 个)

TAB
TAB 2012-12-18
  2 个评论
tusu
tusu 2012-12-19
Can anybody give some example..how to use these files
Walter Roberson
Walter Roberson 2012-12-19
[filename, filepath] = uigetfile('Choose a file');
fullname = fullfile(filepath, filename);
txt_data = fileread(fullname);

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Dialog Boxes 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by