%%可以分块,分块之后可以进行分块执行run section。
关系运算符:~= 不等于。
取余函数:mod(a,b) rem(a,b)。
switch …… case …… case …… case …… otherwise……
连乘函数: prod([1 2 3 4 5])=1*2*3*4*5
clear all 清除所有变量 close all 关闭所有figure
...表示换行(三个点)eg:A=[1 2 3;...
4 5 6]
Ctrl+c 表示暂停程序
function [output1,output2,output3...] =name(input1,input2,,,)
可以利用nargin来判断被给了几个输入量,从而函数执行不同的命令
nargin Input数量
nargout output数量
简洁的函数定义:y=@(x) 2*x+1 其实可以理解成x是参数,然后2*x+1是函数内容,这个内容相较于一般的函数比较短小简洁。