Finding difference between two curves

I am very very new to matlab. I need to find the average of two curves and then subtract it from the third. The problem is that although they have the same limits they do not have the same x-values.

2 件のコメント

Emma
Emma 2013 年 3 月 4 日
I can't take the means of the points as they have different x-values and therefore are not the same thing. I am looking at temperature vs. signal. Although the data sets are all from 50-900degC they are not at the exact same temperature.

サインインしてコメントする。

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 4 日
編集済み: Azzi Abdelmalek 2013 年 3 月 4 日

0 投票

y1=rand(1,10);
y2=rand(1,12);
y3=rand(1,15);
out=y3-mean([y1 y2])

3 件のコメント

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 4 日
Do you want to interpolate?
Emma
Emma 2013 年 3 月 4 日
I was thinking interpolation between each point or using "fit" as my curves I do not think that my curves will fit to a polynomial (see picture)
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 4 日
T1=50:20:900
T2=50:25:900
T3=50:30:900
y1=rand(1,numel(T1))
y2=rand(1,numel(T2))
y3=rand(1,numel(T3))
T=unique([T1 T2 T3])
Y1i=interp1(T1,y1,T);
Y2i=interp1(T2,y2,T);
Y3i=interp1(T3,y3,T);
out=Y3i-mean([Y1i;Y2i])

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by