zoukankan      html  css  js  c++  java
  • 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 ',a);         换行

    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

     

    朝闻道
  • 相关阅读:
    API开放平台基于accessToken实现
    web记住我功能的实现
    SpringBoot整合AbstractRoutingDataSource实现读写分离
    手写简化版SpringBoot
    mybatisGenerator
    C程序编译执行过程
    用WaveX实现音频文件的录音
    java学习--数组
    Linux学习笔记--vim
    PHP常量总结
  • 原文地址:https://www.cnblogs.com/wander-clouds/p/8898221.html
Copyright © 2011-2022 走看看