I have 2 arrays:(adsbygoogle = window.adsbygoogle || []).push({});

andCode (Text):

vxb =

0.0001 0.0001 0.0001 0.0002 0.0002

0.0003 0.0003 0.0003 0.0003 0.0003

0.0003 0.0004 0.0005 0.0005 0.0005

0.0005 0.0006 0.0006 0.0006 0.0006

0.0006 0.0006 0.0007 0.0007 0.0007

.

.

.

I would like to use polyfit to return an array p(,i,j) in which each row of p is the polyfit ofCode (Text):

vtime =

0.2570 0.4500 0.6420 0.8350 1.0280

1.2210 1.4130 1.6060 1.7990 1.9920

2.1840 2.3770 2.5700 2.7630 2.9550

3.1480 3.3410 3.5340 3.7260 3.9190

4.1120 4.3050 4.4970 4.6900 4.8830

.

.

.

p(i,:) = polyfit(vxb(i,:), vtime(i,:), 4).

I know that I can do it with a loop, but I figured MATLAB is smart and there is a syntax I could use to do this.

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Using polyfit() on arrays?

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads - Using polyfit arrays | Date |
---|---|

Using Maxima to plot error in Fourier series | Nov 5, 2017 |

Matlab Solving equation with integration using MATLAB | Aug 4, 2017 |

What Software do you use to do your math manipulations? | May 21, 2017 |

Matlab Append new columns into Excel | Jun 20, 2016 |

**Physics Forums - The Fusion of Science and Community**