フィルターのクリア

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 Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by