哆啦美

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  • GUI调出文件读取框
[filename,pathname] = uigetfile({'*.xlsx';'*.xls';'*.*'},'选择文件'); 
strh = [pathname,filename]; %存储文件的路径及名称
global num txt raw
[num,txt,raw] = xlsread(strh); %读取数据
  • GUI清空坐标系和文本框
axes(handles.axes1); %指定需要清空的坐标轴
cla reset;
set(handles.text4,'String',[]);
set(handles.text5,'String',[]);
set(handles.text6,'String',[]);
  • GUI关闭界面
closereq;
  • GUI界面标题
function xianxingjiemian_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to xianxingjiemian (see VARARGIN)

% Choose default command line output for xianxingjiemian
handles.output = hObject;
movegui(gcf,'center');
set(gcf,'NumberTitle','off','Name','基于MATLAB的自动控制系统人机交互界面设计');
% Update handles structure
guidata(hObject, handles);
  • GUI单选按钮互斥
function radiobutton1_Callback(hObject, eventdata, handles)
% hObject    handle to radiobutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of radiobutton1
set(handles.radiobutton1,'value',1);
set(handles.radiobutton2,'value',0);
  • GUI清除坐标系
try 
    delete(allchild(handles.axes3)); %清除坐标系3中的图像
end
  • cell转化成string
txt = {};
string = cell2mat(txt);
  • 方程组数值解
syms lbd theta3 theta4
eqn = [xe+l4*cos(theta4)+lbd*cos(theta3)-l1*cos(theta1)== 0,...
ye+l4*sin(theta4)+lbd*sin(theta3)-l1*sin(theta1)== 0,...
l4*sin(theta4)+l3*sin(theta3)-h== 0];
[lbd, theta3, theta4] = vpasolve(eqn, [lbd, theta3, theta4],[0,l3; pi/4,9*pi/16; 11*pi/8,2*pi]);

  

  • 方程组解析解
syms x y
eqns = [x^2 + y^2 == 5, x - y == 1];
vars = [x y];
[x, y] = solve(eqns, vars)
  • latex代码
latex(df) %转换为latex代码

  

 

posted on 2023-01-08 20:23  哆啦美  阅读(21)  评论(0编辑  收藏  举报