vectors must be at the same length error
1 次查看(过去 30 天)
显示 更早的评论
Hi, im trying to plot this fuction but im getting th 'vectors must be at the same length' error, Can anybody help to find a solution?
t=-10:10;
x = heaviside(t+2)-heaviside(t-2);
plot(t,x);
y = awgn(x,21,'measured');
plot(t,[x y]);
legend('Original Signal','Signal with AWGN');
0 个评论
采纳的回答
Daniel M
2019-10-20
You are concatenating x and y into a doubly long vector. If you want to plot both signals, do
plot(t,x,t,y)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Vibration Analysis 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!