zoukankan      html  css  js  c++  java
  • matlab学习笔记第四章——统计和MATLAB编程介绍

      1.柱状图:

          >> x = [55,63,69,70,75,78,82,84,85,88,90,96,100];

          >> y = [1,2,1,6,4,7,2,1,3,2,4,2,1];
          >> bar(x,y)

      2.我们可以使用barh命令产生水平的柱状图。

      3.通过调用mean函数,MATLAB会告诉我们一组数据的均值是多少。我们也可以传递数组给mean,MATLAB会告诉我们每一列的均值。

      4.x和y数组的向量乘积。我们用s来代表这个中间和:>> s = sum(x.*y)

      5.使用for循环编程:

          for index = start : increment : finish

            statements
          end

      如果我们把增量参数省略,MATLAB就认为我们把增量设为1。

      6.while语句:

          while condition

            statements
          end

      7.switch语句:

          switch expression

            case 1
              do these statements
            case 2
              do these statements
            case n
              do these statements
          end

  • 相关阅读:
    Ubuntu下cc和gcc的关系
    Ubuntu下makefile的简单使用
    Ubuntu下配置Apache以及搭载CGI
    Easy C 编程 in Linux
    Ubuntu下配置GitHub
    Ubuntu学习之路2
    Ubuntu下配置Java环境
    Vim学习之路1
    将博客搬至CSDN
    ubuntu连接手机的方法
  • 原文地址:https://www.cnblogs.com/hxbbing/p/4587180.html
Copyright © 2011-2022 走看看