Thursday, 3 October 2013

How to generate 3D plots in Matlab ?

How to generate 3D plots in Matlab ?

Use 'surf' command in Matlab

Example:

figure;
x = 1:100;
y = 1:100;
z = magic(100);
surf(x,y,z);

Another example to plot the correlation values of the GPS signal:

figure;
% fSamp = sampling frequency
% fCode = 1.023e6;
% fIf = Intermediate frequency, carFreqs -- dopplers
% x - chip axis
% y - frequency axis
% z - correlation values

x = (1:1:fSamp*1e-3)*fCode./fSamp;
y = carFreqs - fIf;
surf(x,y,abs(corrVal));

No comments:

Post a Comment