0
我是新來matlab,我想加載列表框中的多個文件。到目前爲止,我有這個代碼,但它顯示了我的這個錯誤: 輸入了多餘的參數,請檢查文檔。 這是我的代碼:Matlab加載列表框中的文件錯誤:輸入多餘的參數
% --- Executes on button press in load.
function load_Callback(hObject, eventdata, handles)
% hObject handle to load (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[flnm, flpth,cCheck]=uigetfile({'*.mp3'},...
'File Select',...
'Multiset', 'on');
%fullpathname=strcat(pathname, filename);
%text=audioread(fullpathname);
%set(handles.path_song, 'String',fullpathname);%show full path name in the listbox
assignin('base','flnm',flnm);
assignin('base','flpth',flpth);
assignin('base','cCheck',cCheck);
%If the user did not press the cancell button
if(cCheck==0)
%Reset selection to first entry
set(handles.playlist,'Value',1);
%Show selected filenames
set(handles.playlist,'String',flnm);
end
%LIST------------------------Display Files---------------------------------
function playlist_Callback(hObject, eventdata, handles)
% hObject handle to playlist (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns playlist contents as cell array
% contents{get(hObject,'Value')} returns selected item from playlist
listStr=get(hObject,'String');
listVal=get(hObject,'Value');
%Display Selected files
if(iscell(listStr))
fileName=playlistStr(listVal);
fprintf('Selected file:%s\n',fileName);
else
fileName=listStr;
fprintf('Selected file:%s\n',fileName);
end