Effacer les filtres
Effacer les filtres

Could I use uigetfile without Message "no file, check the file name...." ?

1 vue (au cours des 30 derniers jours)
Kwon
Kwon le 28 Oct 2013
Modifié(e) : Kwon le 28 Oct 2013
I use this code in MATLAB R2012a.
[fileName, pathName, filterIndex] = uigetfile({'*.*';'*.xls';'*.txt';'*.csv'}, 'Select file(s)', 'MultiSelect', 'on','D:\');

Réponse acceptée

Image Analyst
Image Analyst le 28 Oct 2013
Most likely you just tried to use fileName. Bad decision. You need to construct the full filename (folder plus base filename plus extension):
fullFileName = fullfile(pathName, fileName);
Then use fullFileName wherever you tried to use fileName in subsequent code.
  3 commentaires
Image Analyst
Image Analyst le 28 Oct 2013
Then you then you did not use fullfile() as I recommended because if you did, it would have shown a folder name.
Kwon
Kwon le 28 Oct 2013
Modifié(e) : Kwon le 28 Oct 2013
Do you mean like following ? " [fileName, pathName, filterIndex] = uigetfile({'*.*';'*.xls';'*.txt';'*.csv'}, 'Select file(s)', 'MultiSelect', 'on','D:\'); fullFileName = fullfile(pathName, fileName); "
I say one sentence.
I rewrite " of "a.csv" "b.csv" that file name of Select file(s) Window. But when I rewrite the file name, rarely it operate but many view the Message(a.csv The file does not exist. File name, make sure that it is spelled correctly.).

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 28 Oct 2013
That code will not emit that message. The code you have after it might emit such a message.

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by