I'm having trouble plotting with subplot. I've been trying to plot multiple graphs since the variables I'm plotting have multiple outputs but I tried using the comand - subplot(3,2,i5) since im trying to plot 3 rows in two coloums by pulling my info form a for loop. It's giving me a graph but it's also giving me an error "Index exeeds number of subplots". What should I do?
(to solve a little bit of confusion, I'm trying to plot the noise factors + the sine wave to get different snr noise levels)
This is my code:
x_5= sin(2*pi*f*Time_5*6);
title('Signal vs. Time Vector');
noise=rand(size(Time_5))-0.5;
noise_sig= x_5+noise*N_fact(i5);
sig_pwr=sum(x.^2)/length(x);
noise_pwr=sum((noise_sig-x).^2)/length(x);
snr=10*log10(sig_pwr/noise_pwr);
title(sprintf('SNR=%.2f dB',snr));
end
Unrecognized function or variable 'x'.