声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 952|回复: 1

[编程技巧] ??? Error using ==> mtimes

[复制链接]
发表于 2009-3-11 11:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
各位老师,请教一下怎么下面这个简单程序,出错;f函数的两个部分分着写就没事,合起来相乘就不可,为什么呢

??? Error using ==> mtimes
Inner matrix dimensions must agree.
Error in ==> L1 at 2
f=cos(2*pi*t)*exp(-t);   
程序:
t=0:0.05:4;                    %建立时间数组
f=cos(2*pi*t)*exp(-t);         %建立生成函数
subplot(2,2,1),plot(t,f);      %create 2*2 subpicture,and draw line pic
title('plot(t,f)');
subplot(2,2,2),stem(t,f);      %create 2*2 subpic   ,and draw pulese pic
title('stem(t,f)');
subplot(2,2,3),stairs(t,f);    %create 2*2 subpic   ,and draw stairs pic
title('stairs(t,f)');
subplot(2,2,4),bar(t,f);       %create 2*2 subpic   ,and draw bar pic
title('bar(t,f)');
回复
分享到:

使用道具 举报

发表于 2009-3-11 21:06 | 显示全部楼层

回复 楼主 lanqiufeiren888 的帖子

注意点乘.*
t=0:0.05:4;                    %建立时间数组
f=cos(2*pi*t).*exp(-t);         %建立生成函数

评分

1

查看全部评分

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-22 19:41 , Processed in 0.067733 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表