how to make x-axis count in powers of 10 in matlab

To make the x-axis count in powers of 10 in MATLAB, you can use the xscale function. Here is an example:

main.m
x = 0:10:100;
y = x.^2;

plot(x, y);
set(gca, 'XScale', 'log'); % set x-axis to be logarithmic
95 chars
6 lines

In this example, set(gca, 'XScale', 'log') sets the x-axis to use a logarithmic scale, which will count in powers of 10.

related categories

gistlibby LogSnag