ImageVerifierCode 换一换
格式:DOCX , 页数:126 ,大小:537KB ,
资源ID:5443061      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-5443061.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(matlab上机习题详解试题答案课案.docx)为本站会员(b****3)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

matlab上机习题详解试题答案课案.docx

1、matlab上机习题详解试题答案课案P第一次实验答案1 设要求以0.01秒为间隔,求出y的151个点,并求出其导数的值和曲线。clcclearx=0:0.01:1.5;y=sqrt(3)/2*exp(-4*x).*sin(4*sqrt(3)*x+pi/3)y1=diff(y)subplot(2,1,1)plot(x,y)subplot(2,1,2)plot(x(1:150),y1)2绘制极坐标系下曲线(a,b,n自定数据)clccleara=10;b=pi/2;n=5;theta=0:pi/100:2*pi;rho=a*cos(b+n*theta);polar(theta,rho)3. 列出求

2、下列空间曲面交线的程序clcclearx=-5:0.5:5;X,Y=meshgrid(x);z1=X.2-2*Y.2;z2=X.*2-Y.*3;xlabel(x)ylabel(y)zlabel(z)surf(X,Y,z1)hold onsurf(X,Y,z2)k=find(abs(z1-z2)2 error(输入量太多。);else S=N*R*R*sin(2*pi/N)/2; L=2*N*R*sin(pi/N); plot(x,y,str) endaxis equal squarebox on3、编写一个学生成绩管理的程序,完成下列功能:(1) 构造一个学生结构,包括学生的姓名,课程名称(限

3、M门),考试成绩和平均值等域; (2) 从键盘上,连续输入N个学生的情况,分别将这些学生的情况填入到相应的域,若域中没有值即为空或0,并分别计算其平均值写入到其平均值域。(3) 根据平均值排序(由高到低),并输出学生的姓名和平均值。clcclearn=input(please input students number:);for x=1:n number(x)=struct(name,Curriculum1,Curriculum2,Curriculum3,Average,);endfor i=1:n number(i).name=input(name:,s); number(i).Curri

4、culum1=input(please input the scoresnCurriculum1:); number(i).Curriculum2=input(Curriculum2:); number(i).Curriculum3=input(Curriculum3:); number(i).Average=(number(i).Curriculum1+number(i).Curriculum2+number(i).Curriculum3)/3; disp(the average is:) disp(num2str(number(i).Average)end NameCell=cell(1,

5、n);Array=1,n;for i=1:n NameCell(1,i)=number(i).name; Array(i)=number(i).Average;endfor j=1:(n-1) iptr = j; for i=(j+1):n if Array(i)Array(iptr) %比较相邻前后大小 iptr=i; end end if j=iptr %若后面比前面大,互换 Name=NameCell(1,i); NameCell(1,i)=NameCell(1,j); NameCell(1,j)=Name; average=Array(i); Array(i)=Array(j); Ar

6、ray(j)=average; j=1; iptr=j; endenddisp(成绩排序如下:)for i=1:n disp(strcat(名次: ,num2str(i), 名字 ,NameCell(1,i), 平均成绩: ,num2str(Array(i)end 4、使用句柄图像对象绘制曲线:y=2e-0.5xcos(x),同时对曲线进行标注和修饰。x=-12:0.02:12y=2*exp(-0.5)*x).*cos(pi*x)h_f=figure(Position,200 300 300 300,menubar,none)h_a1=axes(position,0.1,0.1,.8,.8)h

7、_t=title(h_a1,函数=2*exp(-0.5)*x).*cos(pi*x)h_1=line(x,y)set(gca,xtick,(-6)*pi (-4)*pi (-2)*pi 0 (2)*pi (4)*pi (6)*pi)set(gca,xticklabel,(-6)*pi, (-4)*pi, (-2)*pi, 0, (2)*pi, (4)*pi,(6)pi)set(gca,xgrid,on,ygrid,on)set(h_1,linewidth,2)set(get(h_t,parent),color,y)h_anm1=annotation(gcf,rectangle,0.1 0.5

8、.8 0.4,FaceAlpha,.7,FaceColor,red)第三次试验答案1、做一个带按钮的界面,当按动“播放”按钮时调入声音文件并播放,显示声音波形,并建立一个用于关闭界面的按钮对象。(提示,找一个.wav文件,简单起见可以在windows目录下找一个文件,将其放在当前工作目录下或搜索路径上。具体用法请参照:y,f,b=wavread(*.wav); % 读入声音文件sound(y,f,b) % 由声卡播放声音plot(y) % 画出波形2、创建一个用于绘图参数选择的菜单对象,其中包含三个选项LineStyle、Marker和Color,每个选项下面又包含若干的子项分别可以进行选择图

9、线的类型、标记点的类型和颜色 (每个子项不少于3个),当按下“绘图”按钮时,根据选项绘制正弦曲线(缺省时为蓝色无标记实线)。(注意使用全球变量)function varargout = shiyan32(varargin)% SHIYAN32 MATLAB code for shiyan32.fig% Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct(gui_Name, mfilename, . gui_Singleton, gui_Singleton, . gui_OpeningFcn, s

10、hiyan32_OpeningFcn, . gui_OutputFcn, shiyan32_OutputFcn, . gui_LayoutFcn, , . gui_Callback, );if nargin & ischar(varargin1) gui_State.gui_Callback = str2func(varargin1);end if nargout varargout1:nargout = gui_mainfcn(gui_State, varargin:);else gui_mainfcn(gui_State, varargin:);end% End initializatio

11、n code - DO NOT EDIT % - Executes just before shiyan32 is made visible.function shiyan32_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

12、with handles and user data (see GUIDATA)% varargin command line arguments to shiyan32 (see VARARGIN) % Choose default command line output for shiyan32handles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes shiyan32 wait for user response (see UIRESUME)% uiwait(h

13、andles.figure1);global cc=bglobal ll=-global mm= % - Outputs from this function are returned to the command line.function varargout = shiyan32_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT);% hObject handle to figure% eventdata reserved - to b

14、e defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structurevarargout1 = handles.output; % -function Untitled_1_Callback(hObject, eventdata, handles)% hObject handle to Untitled_1 (see GCBO)% eventdata re

15、served - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global l % -function Untitled_8_Callback(hObject, eventdata, handles)% hObject handle to Untitled_8 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles st

16、ructure with handles and user data (see GUIDATA)global m % -function color_Callback(hObject, eventdata, handles)% hObject handle to color (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global c % -function Untit

17、led_14_Callback(hObject, eventdata, handles)% hObject handle to Untitled_14 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global cc=r % -function Untitled_15_Callback(hObject, eventdata, handles)% hObject handl

18、e 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)global cc=b % -function Untitled_16_Callback(hObject, eventdata, handles)% hObject handle to Untitled_16 (see GCBO)% eventdata reserved - to be def

19、ined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global cc=g % -function Untitled_17_Callback(hObject, eventdata, handles)% hObject handle to Untitled_17 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with

20、handles and user data (see GUIDATA) global cc=y% -function Untitled_10_Callback(hObject, eventdata, handles)% hObject handle to Untitled_10 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global mm=o % -function

21、Untitled_11_Callback(hObject, eventdata, handles)% hObject handle to Untitled_11 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global mm=* % -function Untitled_13_Callback(hObject, eventdata, handles)% hObject

22、handle to Untitled_13 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) global mm=d % -function Untitled_4_Callback(hObject, eventdata, handles)% hObject handle to Untitled_4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)global ll=- % -function Untitled_5_Callback(hObject, eventdata,

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2