Error using plot: Vectors must be the same length.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Can someone please help? I've generated a plot for Signal3, but I also need to plot a single period from Signal3 (which I've named additive_noise_first) with an appropriate time vector (which I've named tPeriod).
s3 = zeros(1, period);
s3(SinglePeriod >= 0 & SinglePeriod < 2.5) = ((A*SinglePeriod(SinglePeriod >= 0 & SinglePeriod < 2.5))/4);
s3(SinglePeriod >= 2.5 & SinglePeriod < 5) = (((-A*SinglePeriod(SinglePeriod >= 2.5 & SinglePeriod < 5))+(5*A))/4);
Signal3 = repmat(s3, [1 period]); %signal 3
subplot(3,1,3)
plot(t, Signal3, 'r')
title('Signal 3')
xlabel('Time (s)')
ylabel('Amplitude')
hold off
%% 2.0 Generate the noise waveforms
tPeriod = linspace (0, 1, sample+1); %single period
tPeriod(end) = []; %
additive_noise_first = repmat(Signal3, 1, period);
plot(tPeriod, additive_noise_first, 'r');
But I'm getting this error shown below.
Error using plot
Vectors must be the same length.
Error in mission (line 82)
plot(tPeriod, additive_noise_first, 'r');
0 comentarios
Respuestas (1)
KSSV
el 21 de Ag. de 2020
%% 2.0 Generate the noise waveforms
additive_noise_first = repmat(Signal3, 1, period); % assumoing this to be column/ array
tPeriod = linspace (0, 1,length(additive_noise_first)); %single period
plot(tPeriod, additive_noise_first, 'r');
0 comentarios
Ver también
Categorías
Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!