A.*B A點乘B就是對應元素直接相乘
A.^2直接每個元素平方
log(e)=1
exp(1)=e
abs(-1)=1
1*B做除法必須1./B
[value,index]=max(a)最大的元素的位置,value是它的大小,index是他的位置
Max(A)會返回一個維度值個數的較大值
1 5 7
2 4 6會返回5 6 7,
A<3 return if it's smaller than 3
[roll, colum]=find (A<3) returns the position when it's smaller than 3
magic(3) returns a magic square which sum of each row=sum of each collum 甚至是對角線。
sum(a);prod(a);floor(a);ceil(a);prod means *;floor means 0.4~~=0
max(rand(3),rand(3)) pick the bigger one in each count position,no max(rand(3),rand(3),rand(3));
I'm sneezing like in every 2 second,god help my nose.
max(A,[],1/2)行最大,列最大
flipud(eye(2))是上下對稱一下
1 0 0 1
0 1=》 1 0
plot(x,y);%x=[0:0.1:1];
hold on;
xlable('size');
legend('name1','name2')
title('my pic')
print -dpng 'name';
figure(1);plot(t,y1);
subplot(1,2,1);分成橫向一個,縱向兩個的格子,用第一個作圖
axis([0.5 1 -1 1])
clf;
imagesc(A)
iamgesc,colorbar,colormap gray