我建的gui,通过点击import,可以导入excel,并且将数据名称显示出来,比如time
请帮忙看看,为什么不能显示?
plot也不行了
function update_button_Callback(hObject, eventdata, handles)
% hObject handle to update_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
pathname=evalin('base','pathname');
filename= evalin('base', 'filename');
file=[pathname filename];
[x, headertext] = xlsread(file);
[m,n]=size(x);
b=handles.numberdata;
a=m/b+1;
for i= 1:a
% magic_str = [cell2mat(headertext(:,n)),' = x(:,n)'];
%eval(magic_str)
% h.PutWorkspaceData('A', 'base', data)
%eval(magic_str)
%assignin('base',cell2mat(headertext(:,n)), )
y(i,:)=x((1+(i-1)*b),:);
end
for n=1:n
assignin('base',cell2mat(headertext(:,n)),y(:,n) );
end
handles.data=y;
handles.data2=headertext;
guidata(hObject,handles);
%clear pathname
%clear filename
%run zzz;
update_listbox(handles)
%engEvalString(ep, "evalin('base', expression)")
谢谢