matlab课程设计大作业(matlab课程设计大作业曲线绘图)

http://www.itjxue.com  2023-02-10 12:49  来源:未知  点击次数: 

matlab 大作业求做啊

我们也做这种作业啊,加油啊亲。你那个学校什么时候交啊?要是在我们之后,你可以借鉴一下我们的

MATLAB 大作业求助

clear all

close all

clc

A=zeros(3,5,2);

A(:,:,1)=[2001 98 94 80 5;2002 105 97 87 6;2003 121 110 89 8];

A(:,:,2)=[2001 99 98 85 10;2002 113 101 87 12;2003 120 115 80 15];

for i=1:3 %显示结果依次为平均新生、学士毕业生、硕士毕业生及博士毕业生

infor_mean=mean(A(:,2:5,1));

end

infor_mean=infor_mean

total_new=zeros(3,1);%第二问

for k=1:3

total_new(k)=A(k,2,1)+A(k,2,2);

end

total_new=total_new

total_M=sum(A(:,4,1))+sum(A(:,4,2))%第三问

total_SMD=sum(A(:,3:5,1))+sum(A(:,3:5,2));%第四问

total=sum(total_SMD)

year_M=zeros(3,1);%第五问

for j=1:3

year_M(j)=A(j,4,1)+A(j,4,2);

end

year_M_max=max(year_M);

num=find(year_M==year_M_max);

switch num

case 1

disp('电机系和信息系合计有最多的硕士毕业生是2001')

case 2

disp('电机系和信息系合计有最多的硕士毕业生是2002')

case 3

disp('电机系和信息系合计有最多的硕士毕业生是2003')

end

year_S=zeros(3,1);%第六问

for j=1:3

year_S(j)=abs(A(j,3,1)-A(j,3,2));

end

year_S_max=max(year_S);

num2=find(year_S==year_S_max);

switch num2

case 1

disp('电机系和信息系的学士毕业生差额最大是2001')

case 2

disp('电机系和信息系的学士毕业生差额最大是2002')

case 3

disp('电机系和信息系的学士毕业生差额最大是2003')

end

year_N=zeros(3,1); %第七问

for j=1:3

year_N(j)=A(j,3,2)-A(j,3,1);

end

year_N_matrix=find(year_N0);

length_year_N_matrix=length(year_N_matrix);

for k=1:length_year_N_matrix

disp(A(year_N_matrix(k),1,1));disp('电机系收的新生数目比信息系多')

end

for i=1:3

ratios(i)=A(i,3,1)./A(i,2,1);

end

mean_ratio=mean(ratios)

结果已经运行,没检验对错,自己检验吧,这个真不需要注释,全是基本操作,亲!

大作业~~~matlab~~~求助~~~

1.

A=[1 4 8 13;-3 6 -5 -9;2 -7 -12 -8];

A

A =

1 4 8 13

-3 6 -5 -9

2 -7 -12 -8

B=[5 4 3 -2;6 -2 3 -8;-1 3 -97];

B

B =

5 4 3 -2

6 -2 3 -8

-1 3 -9 7

C1=A*B';C2=A'*B;C3=A.*B

C3 =

5 16 24 -26

-18 -12 -15 72

-2 -21 108 -56

C2

C2 =

-15 16 -24 36

63 -17 93 -105

22 6 117 -60

19 46 84 -10

C1

C1 =

19 -82 30

12 27 3

-38 54 29

inv(C1)

ans =

0.0062 0.0400 -0.0106

-0.0046 0.0169 0.0030

0.0168 0.0209 0.0150

inv(C2)

Warning: Matrix is close to singular orbadly scaled.

Results may be inaccurate. RCOND = 8.997019e-019.

ans =

1.0e+015 *

-0.9553 -0.2391 -0.1997 0.2700

0.9667 0.2420 0.2021 -0.2732

-0.4473 -0.1120 -0.0935 0.1264

-1.1259 -0.2818 -0.2353 0.3182

pinv(C3)

ans =

-0.0007 -0.0049 -0.0017

0.0571 0.0125 -0.0109

0.0179 0.0112 0.0067

0.0131 0.0171 -0.0008

2.

(1)

student2012=struct('number',{'20100501','20100502','20100503','20100504','20100505','20100506','20100507','20100508','20100509'},'name',{'张晓霞','郭凯','周明辉','王雪梅','郭志刚','姚大志','王佳薇','黎明','王玲'},'course',{{'高等数学''计算机基础''工程制图''线性代数''体育'}},'score',{[69 87 78 90 60],[82 90 88 100 89],[88 92 91 78 69],[7580 78 70 88],[46 89 69 87 78],[81 74 52 69 79],[59 95 80 78 87],[100 70 89 9591],[78 82 94 59 79]});

student2012

student2012 =

1x9 struct array with fields:

number

name

course

score

(2)

student2012(1).mean=[mean(student2012(1,1).score),mean(student2012(1,2).score),mean(student2012(1,3).score),mean(student2012(1,4).score),mean(student2012(1,5).score),mean(student2012(1,6).score),mean(student2012(1,7).score),mean(student2012(1,8).score),mean(student2012(1,8).score)];

student2012(1).mean

ans =

76.8000 89.8000 83.6000 78.2000 73.8000 71.0000 79.8000 89.0000 89.0000

student2012

student2012 =

1x9 struct array with fields:

number

name

course

score

mean

(3)

提取数学成绩

for k=1:9;

number(k)=student2012(k).score(1);

end

number

number =

69 82 88 75 46 81 59 100 78

计算不及格率

a=0;

for k=1:9

number(k)=student2012(k).score(1);

if number(k)60 a=a+1;

end

end

c=a/9;

c

c =

0.2222

(3)

①找到存在不及格科目的域,并把找到的域的编号设为1

for k=1:9

if(student2012(k).score(1)60|student2012(k).score(2)60|student2012(k).score(3)60|student2012(k).score(4)60|student2012(k).score(5)60)

e(k)=1

else

e(k)=0

end

end

e =

0 0 0 0 1 1 1 0 1

②删除找到的域

m=9;

for k=1:9

if(e(k))

end

end

for k=1:9

end

m=1;

for k=1:9

if(e(k))

student2012(m)=[]

m=m+0

else

m=m+1

end

end

m =

2

m =

3

m =

4

m =

5

student2012 =

1x8 struct array with fields:

number

name

course

score

mean

m =

5

student2012 =

1x7 struct array with fields:

number

name

course

score

mean

m =

5

student2012 =

1x6 struct array with fields:

number

name

course

score

mean

m =

5

m =

6

student2012 =

1x5 struct array with fields:

number

name

course

score

mean

m =

6

(4)

student1{1,1}=['20100502';'20100508'];

student1{2,1}={'郭凯''黎明'};

student1{1,2}={'高等数学''计算机基础''工程制图''线性代数''体育'};

student1{2,2}={[82 90 88 10089];[100 70 89 95 91]};

student1

student1 =

[2x8 char] {1x1 cell}

{1x1 cell} {2x1 cell}

MATLAB课程设计心得

通过实验,是我对MATLAB有了一个基础的了解,在学习MATLAB编程中需要很多的参考书,要尽量多的熟悉matlab自带的函数及其作用,因为matlab的自带函数特别多,基本上能够满足一般的数据和矩阵的计算,所以基本上不用你自己编函数。这一点对程序非常有帮助,可以使程序简单,运行效率高,可以节省很多时间。本次课设中用了很多MATLAB自带的函数,使程序变得很简单而有效。

在编程的过程中学习,程序需要什么知识再去补充,编程是一点一点积累的,所以需要做一些随手笔记什么的。课题需要什么函数,需要什么模块就应该去着重看那个知识点,就应该一步一步学,如果太急于把所有东西都学到,也是不好的,更是实现不了的。

总之,通过这次学习,我了解了一下这个软件总体的功能,以及通过自己编写一些代码也学到了一些用法和知识。我相信通过不时的积累,我会慢慢的学会使用MATLAB。

matlab课程设计 急求!!!!

你可以参考下

这是我今年个人做的matlab课程设计,把源代码拿出来,希望能帮助以后做课设的朋友.适合自动化.电信类专业使用,本课设完成的是任意信号卷积的运算,并且绘制图象.另外这里日后还会有许多编程的代码,如php,c,c++,css,javascript,html,xhtml,xml,mysql等实用代码共朋友们使用.

任意的信号卷积:

function y=juanji(f1,f2)

syms x t;

F1=laplace(f1,x,t);

F2=laplace(f2,x,t);

h3=F1*F2;

h4=simplify(h3);

y=ilaplace(h4,t,x);

```````````````````````````````````````````

function plotbutton1_Callback(hObject, eventdata, handles)

%-------------其他------------%

val=get(handles.listbox1,'value');

str=get(handles.listbox1,'string');

vala=get(handles.a,'string');

c=str2num(vala);

valb=get(handles.b,'string');

d=str2num(valb);

%%*************************************************************************

switch str{val}

case'出输f1(t)和f2(t)';

%---------绘制f1(t)---------%

val1=get(handles.f1,'string');

x=sym(val1);

axes(handles.axes1);

ezplot(x);

%---------绘制f2(t)---------%

val2=get(handles.f2,'string');

x=sym(val2);

axes(handles.axes2);

ezplot(x);

case 'f1(t)*f1(t)'

val3=get(handles.f1,'string');

f1=sym(val3);

y=juanji(f1,f1);

axes(handles.axes3);

ezplot(y);

case 'f2(t)*f2(t)'

val4=get(handles.f2,'string');

f2=sym(val4);

y=juanji(f2,f2);

axes(handles.axes4);

ezplot(y);

case 'f1(at)*f2(bt)'

if(c==1d==1)

val5=get(handles.f1,'string');

f1=sym(val5);

val6=get(handles.f2,'string');

f2=sym(val6);

y=juanji(f1,f2);

axes(handles.axes5);

ezplot(y);

elseif(c~=1||d~=1)

c=num2str(c);

d=num2str(d);

val7=get(handles.f1,'string');

f1=sym(val7);

val8=get(handles.f2,'string');

f2=sym(val8);

y=addm(f1,f2,c,d);

axes(handles.axes6);

ezplot(y);

end

end

function y=addm(f1,f2,c,d) //传递了两个参数来改变a,b的值

syms x t;

F1=laplace(f1,x,t/c);

F1=F1/abs(c);

y1=simplify(F1);

F2=laplace(f2,x,t/d);

F2=F2/abs(d);

y2=simplify(F2);

h3=y1*y2;

y=ilaplace(h3,t,x);

y=simplify(y);

几道matlab大作业题,会的来看看

1. t=0:0.01:2;

x=sin(t);

y=t.^2-1;

plot(t,x,'b',t,y,'r');grid on;

xlabel('时间');

ylabel('函数值');

title('函数曲线');

第2题其他人回答过了,我就不重复了。

4. figure(1)

subplot(221);plot();

subplot(222);plot();

subplot(223);plot();

subplot(224);plot();

plot中添加画图内容。

(责任编辑:IT教学网)

更多

推荐其它软件文章