Borrar filtros
Borrar filtros

Curve fitting??

3 visualizaciones (últimos 30 días)
Jyothy MJ
Jyothy MJ el 9 de Sept. de 2011
I have 3 curves which are related to 2 variables. One dependent and another independent. I want relationship between these variables for all the three curves. Is this possible with curve fitting? I'm not sure. If yes could you please suggest an article closely related the above problem? I'm overwhelmed seeing the contents for curve fitting in general. If not curve fitting what else can help me in this matter? I also have a table with all the values. Can i use that instead of curves to form formula between variables?

Respuestas (1)

bym
bym el 9 de Sept. de 2011
perhaps I am misunderstanding, but the following shows how to fit 3 curves in two variables:
clc;clear;close all
x = sort(rand(20,1)); % independent variable
X = [ones(20,1),x,x.^2]; % Vandermonde matrix
y = X*[1 2 3;2 2 3;3 3 5 ]; % dependant variable; arbitrary coefficients
y = y+rand(20,3)*.5; % add noise
coeff = X\y; % get coefficients
yhat = X*coeff; % get predictions
plot(x,yhat);hold on;
plot(x,y,'.') %plot
HTH

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by