首页 > 其他 > 详细

octave矩阵运算

时间:2017-04-03 13:13:08      阅读:634      评论:0      收藏:0      [点我收藏+]

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

 

octave矩阵运算

原文:http://www.cnblogs.com/SweetBeens/p/6661738.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!