undefined function or variable 'basefilename'

回答 (2 件)

Walter Roberson
Walter Roberson 2020 年 10 月 30 日

0 投票

[file, filepath] = uigetfile({'.png'; '.jpg'}, 'select one or more files', 'D:\', 'Multiselect', 'on');
file = cellstr(file); %uigetfile returns char if user selected only one
FileNames = fullfile(filepath, file); %no loop needed
fullFileName = FileNames{1};
ImageArray = imread(fullFileName);
Your most immediate problem was the typing mistake of basefilename instead of baseFileName, but you had other problems as well.
Steven Lord
Steven Lord 2020 年 10 月 30 日

0 投票

The variable basefilename used on line 8 of your code is not the same as the variable baseFileName defined on line 7. Case matters.

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

質問済み:

2020 年 10 月 30 日

回答済み:

2020 年 10 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by