unable to open a file from a folder........help
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
yourFolder ='C:\Users\Parag\Desktop\open\files';
dirListing = dir([yourFolder '/*.txt*']);
baseFileName = dirListing(1).name;
data=importdata(baseFileName)
set(handles.display2,'string',data);
files are:
0000.txt
0010.txt
0020.txt
0030.txt ...................................
10 commentaires
KSSV
le 18 Nov 2016
Can you tell me what is length(dirListing)?
Have you tried to check is baseFilename a text file?
SANKAR JYOTI NATH
le 18 Nov 2016
KSSV
le 18 Nov 2016
Then is length(dirListing) is 60? How are txt files? What data it has?
SANKAR JYOTI NATH
le 18 Nov 2016
SANKAR JYOTI NATH
le 18 Nov 2016
KSSV
le 18 Nov 2016
If dirListing has got the files information, then your code shall work.
SANKAR JYOTI NATH
le 18 Nov 2016
KSSV
le 18 Nov 2016
what is length(dirlisting)? dirlisting(1).name shows text file 0000.txt ?
SANKAR JYOTI NATH
le 18 Nov 2016
KSSV
le 18 Nov 2016
Then it should work, once you import data must have the file data in it.
Réponses (0)
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!