我在 MATLAB 中有一个界面,它通过按 button2 绘制曲线。现在我无法打印出这个数字。更准确地说,我想添加另一个按钮来打印出情节。这是我的一段代码:
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%clear
%linkdata on
fileName = handles.fileName;
n_var=str2num(get(handles.n_var,'string'));
[x] = readColumns(fileName, n_var);
axes(handles.axes1);
hold on
plot(handles.axes1,x(1:n),'b','LineWidth',2)
hold off
谢谢。