From: Kevin Pratt on
This seems like it should be easy to do, but I can't find info on how to do it anywhere. I am plotting a few points then using basic fitting to fit a linear line to it. What I want to do is input a value for X, and have it return the value for Y on the line.

EX:

x=[0 123]
y=[0 1.08455]
plot(x,y)

Then I use basic fitting to fit the linear line via the GUI. I want to see what the y value is for x=10. I know of a sloppy way to do this via the graph, but I'm hoping there's some way I can do it from the command window (it would be so much faster!)

Thanks in advance!
From: Kevin Pratt on
Scratch my question. I just had it "show equations" on the graph and went from there.

Silly me. :P
From: Steven Lord on

"Kevin Pratt" <opapotamus(a)gmail.com> wrote in message
news:hrd86k$fjo$1(a)fred.mathworks.com...
> This seems like it should be easy to do, but I can't find info on how to
> do it anywhere. I am plotting a few points then using basic fitting to fit
> a linear line to it. What I want to do is input a value for X, and have it
> return the value for Y on the line.
>
> EX:
>
> x=[0 123]
> y=[0 1.08455]
> plot(x,y)
>
> Then I use basic fitting to fit the linear line via the GUI. I want to see
> what the y value is for x=10. I know of a sloppy way to do this via the
> graph, but I'm hoping there's some way I can do it from the command window
> (it would be so much faster!)

If you're using one of the interpolating fits, save it to the workspace
using the second panel, then use PPVAL.

http://www.mathworks.com/access/helpdesk/help/techdoc/data_analysis/f1-15377.html#f1-8524

If you're fitting just a polynomial, use POLYFIT (or export the fit from the
Basic Fitting interface to the workspace) and then evaluate it with POLYVAL.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ


 | 
Pages: 1
Prev: photomosaic
Next: Supervised machine learning