matlab 学习笔记 免费可下载

目录

第一部分:计算器功能的实现... 2

数值显示格式:... 3

第二部分:作为程序语言编程使用... 5

自定义函数... 6

第三部分:变量与档案存取... 8

结构化变量... 8

多维数组... 9

第四部分:基础绘图... 13

对数图像logarithm plot. 20

Histogram (柱状图). 22

Pie charts 饼状图... 25

More 3D line plots. 30

第五部分:gui 可视化界面... 35

第六部分:影像分析... 36

常见的图像算法的函数... 37

二维图形变形转变... 39

交互式选择:... 41

第七部分:数学运算... 41

多项式函数在MATLAB里面的显示:... 41

定积分的计算不同思想:... 43

第八章 求方程的根... 44

第九章 统计学  分为 叙述统计与推理统计... 48

链接:https://pan.baidu.com/s/1p4-Yaz_gZjJOQZwggrbgeQ 
提取码:lxsk

 

 

 

第一部分:计算器功能的实现            int8  int16  int32 int64

数值变量类型可分为     1.numerical     uint8  uint16  uint32 uint64

                                      Single

                                      Double

                       2.logical

                       3.char

                       4.cell

                       5.struct

                    Scalar       function handle(@)

特别的变量与常亮

ans

i,j :complex number

Inf :无穷大

eps: 浮点数精度  eps(1) 默认为1 :最接近1的浮点数  也可以代表精度

NaN: 不是一个数字

Pi: 圆周率 3.14.。。。

>> iskeyword   显示关键字

 

ans =

 

    'break'

    'case'

    'catch'

    'classdef'

    'continue'

    'else'

    'elseif'

    'end'

    'for'

    'function'

    'global'

    'if'

    'otherwise'

    'parfor'

    'persistent'

    'return'

    'spmd'

    'switch'

    'try'

    'while'

优先性:从低到高排列

M-file P-file  Mex-file  private function subfunction  built-in function  bariable

>> cos='this string';

>> cos(8)

 

ans =

 

r

 

>> clear

>> cos(8)

 

ans =

 

   -0.1455

数值显示格式:

如果把A 转换为 什么格式   则使用 format  格式   下一行: A

Style

result

example

Short

Short ,fixed-decimal format with 4 digits after the decimal point

3.1416

Long

Long ,fixed-decimal format with 15 digits after the decimal point for double values,and 7 digits after the decimal point for single values

3.14159263589793

shortE

Short scientific notation with 4 digits after the decimal point

3.1416e+00

longE

Long scientific notation with 15 digits after the decimal point for double values,and 7 digits after the decimal point for single values

3.14162324245259e+00

Bank

Currency format with 2 digits after the decimal point

3.14

Hex

Currency format with 2 digits after the decimal point

400921fb5442d1

rat

Ratio of small integers

355/112

冒号操作:

用于数组、向量、索引等

>> a=1:5;

b=1:3:100;

c=[1:5; 2:3:15;-2:0.5:0];

str='a':2:'z';

 

对数组进行操作:(注重区别有点无点)

>> a=[1 2 3; 4 5 4;9 8 7]

 

a =

 

     1     2     3

     4     5     4

     9     8     7

 

>> b=[3 3 3;2 4 9; 1 3 1]

 

b =

 

     3     3     3

     2     4     9

     1     3     1

操作:+  -  *  /   ^    .    ‘(转置)

x1=a+c;

x2=a/c;

x3=a./c;

x4=a^c;

x5=a.^c;

y1=a+b;

y2=a*b;

y3=a.*b;

y4=a/b;

y5=a./b;

特别的矩阵:

Linspace(): linearly spaced vector    (a,b,c)  c个数,默认100个, a-b

Eye(n):n*n identity matrix

eye(4)

ans =

     1     0     0     0

     0     1     0     0

     0     0     1     0

     0     0     0     1

Zeros(n1,n2):n1*n2 zero matrix

Ones(n1,n2):n1*n2 matrix with every entry as 1

ones(3)

ans =

     1     1     1

     1     1     1

     1     1     1

Diag():diagonal matrix   对角线

v = [2 1 -1 -2 -5]; 

D = diag(v) 

     2     0     0     0     0

     0     1     0     0     0

     0     0    -1     0     0

     0     0     0    -2     0

     0     0     0     0    -5

Rand():uniformly distributed random numbers  随机分布在0-1之间概率矩阵

rand(2)

 

ans =

 

   7.4313e-01   6.5548e-01

   3.9223e-01   1.7119e-01

矩阵常用函数:都是以列为单位 进行操作

Max()             sort()

Max(max())       sortrows()

Min()             size()

Sum()             length()

Mean()            find() 查找索引与非零的值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值