필터 지우기
필터 지우기

Curve fitting??

조회 수: 3 (최근 30일)
Jyothy MJ
Jyothy MJ 2011년 9월 9일
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?

답변 (1개)

bym
bym 2011년 9월 9일
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

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by