MATLAB: How changing the loglog scale x and y axis

loglog

I need to represent numbers from 0.5 to 50 (0.5 5 50) instead of 1 10 100(standard log log scale) is it possible? how can i do?

Best Answer

x = sort( rand(1,40)*49.5 + 0.5 );
y = x.*abs(sin(x));
loglog(x,y)
xlim([0.5 50])
ylim([0.5 50])
nticks = 5;
tickpos = round( logspace(log10(0.5),log10(50), nticks) );
set(gca, 'XTick', tickpos, 'YTick', tickpos)