0
$\begingroup$

A very basic question but puzzled me for long time on how to assign array to variables. For instance, we have array {{t1,x1},{t2,x2}...{tn,xn}} how to assign the first element to variable t and second to variable x so I can do fitting for x=f(t)?

$\endgroup$
0
$\begingroup$
myData = {{t1,x1},{t2,x2},{t3,x3}};

{t,x} = Transpose[myData];

t

{t1,t2,t3}

But are you seeking myFit = Fit[myData, {t^3, t^2, t, 1}, x] (for instance)?

$\endgroup$
  • $\begingroup$ Thanks for your help. that works! And yes I am looking for findfit with known expression but unknown parameters. Because the expression involves integration from 0 to current value of x, that causes trouble. $\endgroup$ – Jack Zhang Dec 9 '14 at 0:51
  • $\begingroup$ But thanks for your help, it solves my data handling problem. $\endgroup$ – Jack Zhang Dec 9 '14 at 1:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.