I want to make my program interactive
조회 수: 2 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
답변 (1개)
TAB
2012년 12월 18일
댓글 수: 2
Walter Roberson
2012년 12월 19일
[filename, filepath] = uigetfile('Choose a file');
fullname = fullfile(filepath, filename);
txt_data = fileread(fullname);
참고 항목
카테고리
Help Center 및 File Exchange에서 Dialog Boxes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!