返回信息流定义两个以上元素矩阵使用方括号
a=[1,2;3,4]
zeroes
eye
cell
ones
linspace等间距
linspace(0,2Pi,100)
rand随机数(平均)
randn(正太)
diag(对角)
定义时用方括号,使用时使用圆括号
a=[1,2,3;4,5,6;7,8,9];
a(1,3)
A=1:2:9
A=1:9
a(end,i)
a(end-3:end,i)
B=[A,2*A;A+2,A+3]
A(:2)=[]
B(2:2:10)=[]
dat=[2,4,6,NaN]
dat=dat(finite(dat))
dat=dat(abs(dat-mean(dat)<=3*std(out))
find找到位置
find (dat>3)
标量函数矩阵操作
mean max min prod std
trace
Kron
def
eig
help matfun
+-*/\^
.* ./ .\ .^
矩阵A B
C=A*B
C=A.*B
x=sym('x')
syms x y z
diff(g,'x')
f=x.^2+y.^2
y=sym('x')+2*sym('x')
collect(g)
t=sym('t')
G=[cos(t),sin(t);-sin(t),cos(t)]
I=G.'*G
I=simple(I)
funtool
sin函数挑战
ex阵列
A(i,j,k)
dim 1 2 3
cat(dim,a1,a2,....)
c=cat(1,a,b)
c(:,:,1)=....
a=1:4
b=repmatr(a,[1,4])
meshgrid
[X,Y]=meshgrid(x,y)
x=1 3 5
y=2 4 6
-result:
X=1 3 5;1 3 5;1 3 5
Y=2 4 6;2 4 6;2 4 6
3 基元阵列
G[1,1]=3
G[1,2]=[1,2;3,5]
G[2,1]='good';
G[2,2]='sin(x)';
s=struct('field1','value1','field2','___')....
s=struct('type',{'big',small'},'color',{'red'},'x',{3,4})
s(1)
type....
s.type...
这是一条镜像帖。来源:北邮人论坛 / ss / #4696同步于 2007/5/24
该镜像源已超过 30 天没有更新,可能在源站已被删除。
SS机器人发帖
[笔记]计算物理 作业课1
mmgroup
2007/5/24镜像同步0 回复
订阅后,新回复会通过你的通知中心匿名送达。
0 条回复
暂无回复 · 你可以订阅本帖等待新回复。