Mathematica to FindFit for multiple data set

  • Mathematica
  • Thread starter Sue Laplace
  • Start date
  • #1
After conducting my experimental work I will have a number of sets of data.

It is easy to use Mathematica to find a fit of just one set, but I would like to fit all sets at once as they are too many to do them all ate once.
They will all be fitted by the same function say y=ax+b, every set having a different value of a and b.

How do I do this?
Thanks in advance.
Sue
 

Answers and Replies

  • #2
1,069
29
Without a concrete specific example it is perhaps difficult to know exactly what the answer should be.

Usually if you want to "do the same thing to a collection of items" Map[] is the solution.

data1={...};
data2={...};
data3={...};
Map[FindFit[#,a x+b,{a,b},x]&,{data1,data2,data3}]

may do what you want.

http://reference.wolfram.com/mathematica/ref/Map.html
 
Last edited:
  • #3
Thank you very much Bill, it is working.
 

Related Threads on Mathematica to FindFit for multiple data set

Replies
14
Views
9K
Replies
5
Views
7K
Replies
0
Views
754
Replies
4
Views
9K
Replies
5
Views
9K
Replies
2
Views
6K
Replies
1
Views
8K
Replies
6
Views
12K
Top