下载此文档

matlab程序(matlab程序).doc


文档分类:IT计算机 | 页数:约29页 举报非法文档有奖
1/29
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/29 下载此文档
文档列表 文档介绍
matlab程序(matlab程序)
1.......................................
## randomly generated 13 random numbers, rounding, sorting, and collection. ##
Clear; clc;
X=100*rand (1,13);
Y=floor (x)
Sort (y)
Unique (y)
2.........
## calculate the factorial of large numbers, you can calculate the large number of accurate numerical quantities and ##
Clear; clc;
N=1997;
S=1;
K=0;
For i=1:n
S=s*i;
While s>10
S=s/10;
K=k+1;
End
End
Factorial (n)
S
K
3.........
## calculated x^ (1/x) of the maximum value, and mapping. ##
Clear;
Clc;
Tic
X=linspace (1,1010000);
Y=x.^ (1./x);
S=max (y)
Plot (x, y,'r')
Grid on
TOC
4.........
## combination number, number and the situation will likely show ##
Clear; clc;
N=5;
A=100*rand (1,6)
B=floor (A)
The number binations of s=nchoosek (n, 2)%
Nchoosek (1:n, 2)% for binations of 2 numbers in 1, 2, 3... N
Nchoosek (B, 2)% for random vector (rounding after order)
5.........
The answer to the problem of ## ## white chicken
Clear; clc;
For x=0:20
For y=0:34
For z=0:3:100
If (x+y+z==100) & (5*x+3*y+z/3==100)
T (1) =x;
T (2) =y;
T (3) =z;
T
End
End
End
End
6.........
## calculation function in the numerical solution of a given interval, into the test is correct, error free ##
Clear; clc;
T=fzero ('exp (x) -3+2*x', [0 2])
A=exp (T) -3+2*t
7.......................................
## do relativity map display speed and the speed of light effect on the relativity factor ##
Clear; clc;
X=linspace (0,);
Y=1./sqrt (1-x.^2);
Plot (x, y,'r')
Grid on
8.........
## ## three-dimensional spiral figure painting
Clear
CLC
T=0:pi/50:100*pi;
Y1=sin (t);
Y2=cos (t);
Plot3 (Y1, Y2, t);
Title ('helix');
Text (0,0,0,'origin');
Xlabel ('sin (T) ')
Ylabel ('cos (T) ')
Zlabel ('t');
Grid on;
9............
## given x, the range of Y, and gives the z=f (x, y) function, make three-dimensional map ##
Clear; clc;
T=0::2;
X=-2::2;
[T, X]=meshgrid (T, X);
Y=cos (2*pi* (3*T-X));
Mesh (T,

matlab程序(matlab程序) 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数29
  • 收藏数0 收藏
  • 顶次数0
  • 上传人rjmy2261
  • 文件大小23 KB
  • 时间2017-11-22