matlab函数

1.

normpdf

格式:

Y = normpdf(X,mu,sigma)

含义:

2.

 mvnrnd

从多元正态分布中产生随机数

格式:

r = mvnrnd(MU,SIGMA,cases)

产生cases个随机数,服从 均值mu,方差sigma的多元正态分布

3.

 load fisheriris

 load discrim

The sample data contains ratings of cities according to nine factors such as climate, housing, education, and health in the matrix ratings .

matlab中的自带数据

4.

gscatter 

格式:

gscatter(x,y,group)
gscatter(x,y,group,color,sym,size)
gscatter(x,y,group,color,sym,size,doleg)

load discrim

figure;
gscatter(ratings(:,1),ratings(:,2),group,'bg','*o')%ratings 包含于 discrim
xlabel('climate');
ylabel('housing');

 

  结果:

 5.

存入文件

fopen+fprintf

 

>> a=[17 24 1 8 15;23 5 7 14 16 ;4 6 13 20 22 ;10 12 19 21 3 ;11 18 25 2 9 ];

>> fid = fopen('b.txt','wt');

fprintf(fid,'%g\n',a);       \n 换行

fclose(fid);

 6.

unifrnd

随机生成数(组)

R = unifrnd(A,B,m,n,...) or R = unifrnd(A,B,[m,n,...])返回 m*n阵列

unifrnd(0,5,2,3)

ans =

4.0736 0.6349 3.1618
4.5290 4.5669 0.4877

 

转载于:https://www.cnblogs.com/wander-clouds/p/8898221.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值