scatter and plot are not same?
I used scatter and plot command as per the exercise given. i plotted them in subplot to have comparison for the given data x=linspace(1,20,100) and y=5x3. I  am getting exactly same plot. while in tutorial answer says 'NO'. why this is so?

Python-3.4.3 Other-Types-Of-Plots 07-08 min 10-20 sec 22-04-20, 3:49 p.m. gourihalde@gmail.com

Answers:

To combine multiple plots in one graph, use the “hold on” command, such as:
plot(1:10)
hold on
plot(11:20)
hold off
22-04-20, 3:56 p.m. arunprasadchamy@gmail.com


snr=0:1:15;
for ii=1:length(snr)
x=randint(1,100000); % Generating bits
y=pskmod(x,2); % Generating BPSK modulated data
ynoisy=awgn(y,snr(ii)); % Adding AWGN noise to data
z=pskdemod(ynoisy,2); % Demodulating
error(ii)=length(find(x-z~=0));
end
semilogy(snr,error)
hold
snr=0:1:15;
for ii=1:length(snr)
x=randint(1,100000); % Generating bits
y=pskmod(x,4); % Generating QPSK modulated data
ynoisy=awgn(y,snr(ii)); % Adding AWGN noise to data
z=pskdemod(ynoisy,4); % Demodulating
error(ii)=length(find(x-z~=0));
end
semilogy(snr,error)
grid
22-04-20, 3:57 p.m. arunprasadchamy@gmail.com


No, plot and scatter do not give you the same output graphs even though in your example they may look like the same graph.

In order to understand the difference, try reducing the number of point in x for example use x = linspace(1,20,5) and for the same value of y try plotting the two different graphs.

scatter gives you points, plot gives you a line graph by default
22-04-20, 7:12 p.m. ankitrj.iitb
thanks.
23-04-20, 1:10 a.m. gourihalde@gmail.com


Click here to reply/comment online