How can I use MATLAB for curve fitting and generating an equation for g(f)?

  • Thread starter Thread starter coffeem
  • Start date Start date
  • Tags Tags
    Matlab
AI Thread Summary
To perform curve fitting in MATLAB, the user needs to utilize the Curve Fitting Tool, which can generate a fitted curve from data points but may not directly provide an equation. The user is struggling to extract a mathematical function from the tool and is looking for guidance on how to achieve this, particularly for the function g(f). Additionally, the user needs to square the resulting function and integrate it over specified limits. They are seeking step-by-step instructions rather than a direct solution, as they aim to learn the process for future applications. The urgency of the request is emphasized, with a deadline for completion.
coffeem
Messages
91
Reaction score
0

Homework Statement



Hi, I am a second year University student in the UK. I am trying to plan my labs and as part of this am trying to work out how I use MATLAB to do some curve fitting. What I wish to do is to get some points and for MATLAB to find me an equation of this curve to a reasonable degree of accuracy. I then need to square this function and finally to integrate it over some limits.

However I have looked up how to do this in a couple of books in my university library and have so far been unable to complete even the first part of this task. In the books which I found on this I am told to use the 'Basic Fitting' function. However the version of MATLAB which I have only has the Curve fitting tool, which does not appear to give me an equation but merely draws a pretty line for me, after around three hours of playing around this is getting somewhat tiresome.

Note - the sample data which I have been trying to use can be downloaded from: http://www.nottingham.ac.uk/~ppzwm/downloadsindex.htm and clicking on the g_of_f.mat link under the Johnson Noise heading. I need to generate the function of g(f). However I would rather that you told me how to do this rather than just providing me with the answer as I have to do this again independently.

Thanks
 
Last edited by a moderator:
Physics news on Phys.org
Hey can someone please give me some pointers for this. I need to have this figured out by tomorrow.
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...

Similar threads

Replies
4
Views
2K
Replies
32
Views
2K
Replies
2
Views
3K
Replies
2
Views
1K
Replies
1
Views
2K
Replies
2
Views
3K
Back
Top