t=0:0.1:5*pi; %范围
y=exp(-t/4).*sin(3*t); %注意中间是.*
y0=exp(-t/4); %两条包络线
y1=-y0;
plot(t,y, '+r', t, y0, '-b', t, y1, '-b');
如果t是一个值,写为sin(t)*(e^t)就ok
如果t矩阵,那么要写为sin(t).*(e^t)
代码验证成功,可以运行
x=rand(3,4);
y=rand(4,5);
[row1, col1] = size(x);
[row2, col2] = size(y);
if col1 ~= row2
disp('input is error');
else
result = zeros(row1, col2);
for ii=1:row1
for jj=1:col2
result(ii,jj) = sum(sum(x(ii,:) .* (y(:, jj))' ));
end
end
end
z=x.*y?
你是这个意思吗?