当前位置:编程学习 > Matlab >>

matlab问题,在线等待答案

for n=1:4 A=Img5; B=plate; a=A-mean2(A); b=B-mean2(B); like(n)=sum(sum(a.*b))/sqrt(sum(a.*a)*sum(sum(b.*b))); end 这个程序是什么意思啊,其中A,B都是一幅图片,还有.*是什么符号啊? 在线等待
答案:.*是矩阵的相乘
c=[1 2 3;4 5 6;7 8 9]

c =

     1     2     3
     4     5     6
     7     8     9

>> b=8.*c

b =

     8    16    24
    32    40    48
    56    64    72
这个程序有错误,应该是like=sum(sum(a.*b))/sqrt(sum(sum(a.*a))*sum(sum(b.*b)));
正确
img5=imread('peppers.png');
plate=imread('rice.png');
img5=rgb2gray(img5);
img5=img5(1:256,1:256);
>> A=img5;
>> B=plate;
>> a=A-mean2(A);       
    b=B-mean2(B)
like=sum(sum(a.*b))/sqrt(sum(sum(a.*a))*sum(sum(b.*b))); 
好像是图像-均值后,两幅图像的和所占各自图像和的乘积的平方的比例
其他:.*是将两个矩阵中的数按照行列分别相乘,就是点乘的意思,不像那种矩阵乘法。这个程序是不是算图像的相似度之类的东西啊?对图像处理不了解 1.
a) syms x; int(x*sin(x^2))
b) syms x; int(x^x, 0, 4)
c) syms x; limit( (tan(x)-sin(x))/x^3, 0)
d) syms x; limit( x * ( sqrt( x^2 + 1) - 1));

2.
a) syms x; int(sin(x)/x, 0, inf) 
b) syms x; limit( (1 + 1/x)^x, inf)

3.
a) A=[0,0,1;0,1,0;1,0,0]; [V,D]=eig(A)
b) A=[1,1,1,1;1,1,-1,-1;1,-1,1,-1;1,1,-1,1]; [V,D]=eig(A)

1.
a)
syms x;
y=taylor(log(1+x), 4);
x1=1:10;
y1=polyval(sym2poly(y), x1);

figure; hold on;
plot(x1, log(1+x1), 'b-', 'Display Name', 'log(1+x)');
plot(x1, log(1+x1), 'k-', 'Display Name', 'Taylor Series expansion of log(1+x)');

b) 按照上面那么做

剩下的太多了
 

上一个:matlab编程:怎么让矩阵A的对角线上的元素加上同一个数,而其他的不变?用程序编出来,谢谢
下一个:matlab的M文件不能运行?求解!!!!

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,