Calculating the gradient of a logarithmic scale

Click For Summary
SUMMARY

The discussion focuses on calculating the gradient of a logarithmic scale using MATLAB for the dataset provided. The user, Kyle, is attempting to determine whether to use the original values or their logarithmic counterparts to find the gradient of a line plotted on a logarithmic graph. It is established that for a log-log plot, the gradient should be calculated using the logarithmic values, specifically log base 10, as the relationship follows the form log(y) = a log(x), leading to y = x^a.

PREREQUISITES
  • Understanding of logarithmic functions and their properties
  • Familiarity with MATLAB for data plotting
  • Knowledge of linear regression techniques in logarithmic contexts
  • Basic concepts of exponential functions and their graphical representations
NEXT STEPS
  • Learn how to implement MATLAB's polyfit function for linear regression on log-log plots
  • Explore the implications of different logarithmic bases in data analysis
  • Study the relationship between power laws and logarithmic transformations
  • Investigate advanced plotting techniques in MATLAB for better data visualization
USEFUL FOR

Researchers, data analysts, and students who are working with logarithmic data transformations and require clarity on gradient calculations in MATLAB.

blizzard12345
Messages
11
Reaction score
0

Homework Statement



hi i have the folowing data i would like to plot in matlab

plotERRLW =

0.0466 0.0111 0.0074 0.0046
NX =

50 500 1000 2000
i am using a logarithmic graph to gain a straight line, if i wished to find the gradient of the line would i use the change in the original numbers or change in the numbers after i have taken a log of them?

(also if i have to take a log of them what base does loglog naturally plot)

i have tried a number of options already but can't seem to get the correct answer (i know it should be close to 2) thanks in advance



Homework Equations



i believe the data is of the form plotERRLW = NX^(alpha)



The Attempt at a Solution



so far i have been taking the log base 10 of the numbers in question and simply dividing the log of the error with the log of NX

thanks in advance kyle
 
Physics news on Phys.org
A log plot of (x, y) is a plot of (x, log(y)). If it is a straight line, they you are saying that log(y)= ax+b so that [itex]y= e^{ax+b}= e^be^{ax}=Ce^{ax}[/itex], a general exponential function.

A "log-log" plot of (x, y) is a plot of (log(x), log(y)). If a log-log plot gives a straight line through the origin, then log(y)= a log(x) so that [itex]y= x^a[/itex].
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
16K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
3
Views
2K