📄 t_10.m
字号:
function varargout = T_10(varargin)
% T_10 M_ZPS1-file for T_10.fig
% T_10, by itself, creates a new T_10 or raises the existing
% singleton*.
%
% H = T_10 returns the handle to a new T_10 or the handle to
% the existing singleton*.
%
% T_10('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in T_10.M_ZPS1 with the given input arguments.
%
% T_10('Property','Value',...) creates a new T_10 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before T_10_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to T_10_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Copyright 2002-2003 The MathWorks, Inc.
% Edit the above text to modify the response to help T_10
% Last Modified by GUIDE v2.5 13-Nov-2008 18:42:28
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @T_10_OpeningFcn, ...
'gui_OutputFcn', @T_10_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before T_10 is made visible.
function T_10_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 T_10 (see VARARGIN)
% Choose default command line output for T_10
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes T_10 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = T_10_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
% --------------------------------------------------------------------
function M_YG5_Callback(hObject, eventdata, handles)
% hObject handle to M_YG5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=5;
topicstr='5、函数 , ,';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_YG10_Callback(hObject, eventdata, handles)
% hObject handle to M_YG10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=10;
topicstr='10、使用while循环确定级数2k-3k-1(k=1,2,3,4…)前多项的总和将大于2000,这些项的总和是多少?';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_YG15_Callback(hObject, eventdata, handles)
% hObject handle to M_YG15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=15;
topicstr='15、计算 的乘积。提示,用conv命令。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_YG25_Callback(hObject, eventdata, handles)
% hObject handle to M_YG25 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=25;
topicstr='25、请在同一个窗口中绘制y1=2cos(x)-sin2(x),y2= sin(2x)cos(x),y1用蓝色点划线,y2用红色实线。在图中用gtext命令为两条曲线进行标识,并用legend命令完成示例。提示,请参考老师提供的PPT,里面有完整的范例。x在[-10,10]中取值。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_YG23_Callback(hObject, eventdata, handles)
% hObject handle to M_YG23 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=23;
topicstr='23、经调查,大学生每月的消费为:饭费20%,娱乐25%,购物20%,剩下的为学习费用,请用饼图绘制出这些数据,并对娱乐加以突出。提示,用pie命令。并且,用户可以选择是2维显示还是3维显示。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_XY9_Callback(hObject, eventdata, handles)
% hObject handle to M_XY9 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=9;
topicstr='9、使用for循环确定 级数5k3(k=1,2,3,4…)中前10项的总和。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_XY19_Callback(hObject, eventdata, handles)
% hObject handle to M_XY19 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=19;
topicstr='19、数组A=[3 5 -4;-8 -1 33;-17 6 -9]';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_XY24_Callback(hObject, eventdata, handles)
% hObject handle to M_XY24 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=24;
topicstr='请将图形窗口划分为2*2份,在第一行的两个子图合并为一个图,在其中绘制sin(2x)cos(x),在第二行的左边子图中绘制sin(x)+cox(2x),在右边子图中绘制2cos(x)-sin2(x)。x在[-10,10]中取值。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function Untitled_15_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_15 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function Untitled_16_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function M_ZY3_Callback(hObject, eventdata, handles)
% hObject handle to M_ZY3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=3;
topicstr='3、计算 ;';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZY8_Callback(hObject, eventdata, handles)
% hObject handle to M_ZY8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=8;
topicstr='8、x=[-15,-8,9,8,5],y=[-20,12,-4,8,9]。请在x中找出比y中对应元素值大的元素值和索引(所谓索引,就是满足条件的那些数所在的位置)。提示,用逻辑数组。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZY13_Callback(hObject, eventdata, handles)
% hObject handle to M_ZY13 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
global A;
global B;
topicnum=13;
topicstr='13、(采用子菜单方式)';
set(handles.M_topic,'String',topicstr);
A=[1 4 2
2 4 100
7 9 7
3 3 42];
B=log10(A);
% --------------------------------------------------------------------
function M_ZY18_Callback(hObject, eventdata, handles)
% hObject handle to M_ZY18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=18;
topicstr='18、请先创建一个函数,该函数可以完成20x2-200x+30的计算,为这个函数取名为m_compute,在第18题中令x=5,并直接调用这个函数进行计算。提示:老师会抽查该题的编程情况,不能用直接计算的方式得到结果,必须用调用函数的方式。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function Untitled_21_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_21 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --------------------------------------------------------------------
function M_ZPS1_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=1;
topicstr='1、计算6πtan-1(12.5)+4的值;';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZPS6_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS1_ZPS6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=6;
topicstr='6、摆线是沿x轴旋转,且半径为r的圆形国界圆周上点P所描述的曲线。用参数形式描述的曲线方程为: 。请绘制出当r=10和0≤φ≤4π时的摆线图形。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZPS11_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=11;
topicstr='11、将A.xls读入到程序中(提示,用xlsread命令),保存在变量AA中。提示:这道题采用子菜单的方式,即第11题下面还有子菜单。子菜单项“A”完成“a”小题,以此类推。a.请创建一个由AA中中第二列到第4列所有元素组成的4*3维的数组B。b.请创建一个由AA中头两行和后三列所有元素组成的2*3维的数组C。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZPS16_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=16;
topicstr='16、有一个多项式,它的根为1,3+5i和3-5i,请求出这个多项式。提示,用poly命令。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZPS26_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS26 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=26;
topicstr='26、绘制y=sinx,并用title命令给出标题“y=sinx”,x在[-10,10]中取值。请将数据点的形状设置为菱形,大小为10号,外边缘颜色为红色,里面为绿色。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZGH2_Callback(hObject, eventdata, handles)
% hObject handle to M_ZGH2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=2;
topicstr='2、找出13x^3+182x^2-184x+2503=0 的根。提示,用roots命令。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZGH7_Callback(hObject, eventdata, handles)
% hObject handle to M_ZGH7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=7;
topicstr='求解下列方程组: 7x+14y-6z=95,12x-5y+9z=-50,-5x+7y+15z=145,请将答案分别显示在3个编辑框中。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZGH12_Callback(hObject, eventdata, handles)
% hObject handle to M_ZGH12 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
global AA;
topicnum=12;
topicstr='12、用全局变量的方式得到AA。(这道题采用子菜单的方式进行解答和显示。)a.求每一行中的最大值和最小值。b.求每一列中的最大值和最小值。c.求每一行的和。d.求每一列的均值。';
AA=[3 7 -4 12;-5 9 10 2;6 13 8 11;15 5 4 1];
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZGH17_Callback(hObject, eventdata, handles)
% hObject handle to M_ZGH17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
topicnum=17;
topicstr='17、请计算 中,当x=某一数时的值。提示,1)用polyval命令,2)给x赋值要通过编辑框输入,如在编辑框中输入3,就表示计算该公式当x=3时的值。这个值由老师输入,你们应该在文本框中给出提示,如请“输入一个数”,输入后,老师按“确定”键就进行计算,老师若按“取消”键,则编辑框清空。';
set(handles.M_topic,'String',topicstr);
% --------------------------------------------------------------------
function M_ZGH27_Callback(hObject, eventdata, handles)
% hObject handle to M_ZGH27 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global topicnum;
global P;
topicnum=27;
topicstr='27、请用imread函数显示一幅图像(老师给了几幅,请选择一个),然后用subimage函数把图像给显示出来。然后提供一个按钮,当用户按下按钮后,这幅图像会变成灰度图,用rgb2gray函数就可实现彩色图转换成灰度图。看看效果好吗?怎么样,下学期选老师的《数字图像处理》课吧?嘿嘿';
set(handles.M_topic,'String',topicstr);
P=imread('PIC4','bmp');
axes(handles.M_axes);
subimage(P);
% --------------------------------------------------------------------
function M_YFY_Callback(hObject, eventdata, handles)
% hObject handle to M_ZPS1_YFY (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -