Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Linear fit

Subject: Linear fit

From: manish sharma

Date: 21 Sep, 2010 08:27:20

Message: 1 of 4

I have two vectors:
W=[.46;.25;.2; .083;.001]
A1=[1.7327 ;1.7222; ;1.7189 ;1.7079 ;1.7032]

I can fit the line after I got the result by followinhg : TOOLS-->BASIC FITTING-->LINEAR

But I need a command so as to get the plot as a linear fit of the above points.

Please help me out.

Subject: Linear fit

From: mat001

Date: 21 Sep, 2010 08:49:04

Message: 2 of 4

"manish sharma" <mks_2k6@yahoo.com> wrote in message <i79q98$ee$1@fred.mathworks.com>...
> I have two vectors:
> W=[.46;.25;.2; .083;.001]
> A1=[1.7327 ;1.7222; ;1.7189 ;1.7079 ;1.7032]
>
> I can fit the line after I got the result by followinhg : TOOLS-->BASIC FITTING-->LINEAR
>
> But I need a command so as to get the plot as a linear fit of the above points.
>
> Please help me out.

try to get m code when you do liner fit through tool. And try to understand.

Subject: Linear fit

From: John D'Errico

Date: 21 Sep, 2010 09:46:03

Message: 3 of 4

"manish sharma" <mks_2k6@yahoo.com> wrote in message <i79q98$ee$1@fred.mathworks.com>...
> I have two vectors:
> W=[.46;.25;.2; .083;.001]
> A1=[1.7327 ;1.7222; ;1.7189 ;1.7079 ;1.7032]
>
> I can fit the line after I got the result by followinhg : TOOLS-->BASIC FITTING-->LINEAR
>
> But I need a command so as to get the plot as a linear fit of the above points.
>
> Please help me out.

help polyfit

John

Subject: Linear fit

From: manish sharma

Date: 22 Sep, 2010 19:36:04

Message: 4 of 4

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <i79usr$jpp$1@fred.mathworks.com>...
> "manish sharma" <mks_2k6@yahoo.com> wrote in message <i79q98$ee$1@fred.mathworks.com>...
> > I have two vectors:
> > W=[.46;.25;.2; .083;.001]
> > A1=[1.7327 ;1.7222; ;1.7189 ;1.7079 ;1.7032]
> >
> > I can fit the line after I got the result by followinhg : TOOLS-->BASIC FITTING-->LINEAR
> >
> > But I need a command so as to get the plot as a linear fit of the above points.
> >
> > Please help me out.
>
> help polyfit
>
> John


THANKS John....I got my result with polyfit and plot....

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us