MATLAB矩阵元素数量不一样怎么解决?。
2 views (last 30 days)
Show older comments
程序如下:
clear all;
% fs = 100*10^(7);
% T = 1/fs;
t=1:80;
tau1 = 0.1;
A=1;
f=15;
pd=zeros(1,80);
for i=1:length(t)
pd(i)=A.*exp(-t./tau1).*sin(2.*pi.*f.*t);
end
figure;
plot(t,pd)
xlabel('time in nanosecs')
ylabel('amplitude in volts')
xlim([0 80])
ylim([0 1])
title('Typical PD Pulse')
hold on
line([-10 0],[0 0], ylim)
运行后报错:
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.
Error in ==> jubufangdian2 at 12
pd(i)=A.*exp(-t./tau1).*sin(2.*pi.*f.*t);
本人使用的是MATLAB 7.8.0(R2009a),win10系统
0 Comments
Accepted Answer
gscgudn
on 19 May 2023
赋值那句里面的t要改成t(i)
请去阅读论坛《 MATLAB最基础教程(超链接,自己点进去看) 》《 论坛常见问题归纳(超链接,自己点进去看) 》等帖子,或者入门书籍如《 邢树军译matlab教程(超链接,自己点进去看) 》,里面全有介绍和讲解
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!