agc/example: consolidating plots into one figure
@@ -96,25 +96,21 @@ int main(int argc, char*argv[])
fprintf(fid,"n = %u;\n", num_samples);
fprintf(fid,"clear all;\n");
fprintf(fid,"close all;\n\n");
-
- // print results
for (i=0; i<num_samples; i++) {
fprintf(fid," x(%4u) = %12.4e + j*%12.4e;\n", i+1, crealf(x[i]), cimagf(x[i]));
fprintf(fid," y(%4u) = %12.4e + j*%12.4e;\n", i+1, crealf(y[i]), cimagf(y[i]));
fprintf(fid,"rssi(%4u) = %12.4e;\n", i+1, rssi[i]);
}
-
-
fprintf(fid,"\n\n");
fprintf(fid,"n = length(x);\n");
fprintf(fid,"t = 0:(n-1);\n");
- fprintf(fid,"figure;\n");
+ fprintf(fid,"figure('position',[100 100 800 600]);\n");
+ fprintf(fid,"subplot(2,1,1);\n");
fprintf(fid," plot(t,rssi,'-k','LineWidth',2);\n");
fprintf(fid," xlabel('sample index');\n");
fprintf(fid," ylabel('rssi [dB]');\n");
fprintf(fid," grid on;\n");
- fprintf(fid,"\n\n");
- fprintf(fid,"figure;\n");
+ fprintf(fid,"subplot(2,1,2);\n");
fprintf(fid," plot(t,real(y),t,imag(y));\n");
fprintf(fid," xlabel('sample index');\n");
fprintf(fid," ylabel('agc output');\n");
