Plotting a best fit curve over a histogram

Click For Summary
SUMMARY

The discussion focuses on plotting a best fit curve over a histogram using MATLAB 2010. The user successfully loads data from a .mat file using the command x=load('filename.mat','-ascii'); and generates a histogram with hist(x,300);. However, they encounter difficulties in utilizing the Curve Fitting Toolbox to add a best fit line to the histogram. The conversation also briefly touches on a related question about plotting x,y data on a histogram in Mathematica.

PREREQUISITES
  • Familiarity with MATLAB 2010 and its syntax
  • Understanding of histogram plotting functions in MATLAB
  • Knowledge of the Curve Fitting Toolbox in MATLAB
  • Basic statistical concepts related to best fit lines
NEXT STEPS
  • Research how to use the Curve Fitting Toolbox in MATLAB 2010
  • Learn about the polyfit function for polynomial fitting in MATLAB
  • Explore advanced histogram plotting techniques in MATLAB
  • Investigate how to plot x,y data on histograms in Mathematica
USEFUL FOR

Data analysts, MATLAB users, and statisticians looking to enhance their data visualization skills, particularly in fitting curves to histograms.

matt_crouch
Messages
157
Reaction score
1
Im analyzing some data from a previous student I am trying to plot a line of best fit over the histogram and hense find the value of the coefficiants

the files had to be loaded as -ascii so this is the code i have typed so far

x=load('filename.mat','-ascii'); mean(x); hist(x,300)

this then produces the graph how do i add a best fit line to this. I have the curve fit toolbox but don't seem to be able to use this to give me a plausable best fit. I am using Matlab 2010

any help would be appreciated
:)
 
Physics news on Phys.org
How to plot for x,y data on Histogram in Mathematica

hey, How to plot for x,y data on Histogram in Mathematica?
I saw The Histogram function is just ploting y data,
 

Similar threads

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