% Unit 1 (MATLAB Course @ UAM)
% log-log plot exercise
% (c) Alexander Knebe

%===============
% loglog plots
%===============
clear all
close all
clc

% the range and number of x-values
xmin = 1
xmax = 1000
N    = 100

% generate x-vector (either logarithmically or linearly spaced)
x = logspace(log10(xmin), log10(xmax), N);
%x = linspace((xmin), (xmax), N);

% some power-law
y = x.^3.5;

% use plot
figure(1)
plot(log10(x),log10(y),'+')
xlabel('log(x)')
ylabel('log(y)')

% use loglog
figure(2)
loglog(x,y,'+')
xlabel('x')
ylabel('y')

