Effacer les filtres
Effacer les filtres

vectors must be at the same length error

2 vues (au cours des 30 derniers jours)
fatemeh p
fatemeh p le 20 Oct 2019
Commenté : fatemeh p le 20 Oct 2019
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');

Réponse acceptée

Daniel M
Daniel M le 20 Oct 2019
You are concatenating x and y into a doubly long vector. If you want to plot both signals, do
plot(t,x,t,y)

Plus de réponses (0)

Catégories

En savoir plus sur Vibration Analysis dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by