フィルターのクリア

Get one best curve (graph) from 5 sets of curve.

1 回表示 (過去 30 日間)
deepak maurya
deepak maurya 2021 年 8 月 8 日
コメント済み: Star Strider 2021 年 8 月 9 日
I have 5 curves from experiments and 3 are coinciding as well as other 2 are coinciding as shown below.
But I want one curve from both sets. Or best fit from both sets: I have to insert the best fit into computational work(ANSYS).
Can you guide me with commands or ideas to write code?

回答 (2 件)

KSSV
KSSV 2021 年 8 月 8 日
Read about polyfit.

Star Strider
Star Strider 2021 年 8 月 8 日
The plotted data all appear to have a zero intercept, so to get one slope for all of them, this works:
Set1 = [0:0.1:0.6; (0:0.1:0.6)*1.3+randn(size(0:0.1:0.6))/25];
Set2 = [0:0.1:0.7; (0:0.1:0.7)*1.1+randn(size(0:0.1:0.7))/25];
Set3 = [0:0.1:0.5; (0:0.1:0.5)*0.9+randn(size(0:0.1:0.5))/25];
Set4 = [0:0.1:0.8; (0:0.1:0.8)*0.8+randn(size(0:0.1:0.8))/25];
Set1(2,:) = Set1(2,:)-Set1(2,1);
Set2(2,:) = Set2(2,:)-Set2(2,1);
Set3(2,:) = Set3(2,:)-Set3(2,1);
Set4(2,:) = Set4(2,:)-Set4(2,1);
CommonSlope = [Set1(1,:), Set2(1,:), Set3(1,:), Set4(1,:)].' \ [Set1(2,:), Set2(2,:), Set3(2,:), Set4(2,:)].'
CommonSlope = 0.9709
CommonLine = Set4(1,:) * CommonSlope;
figure
hold on
plot(Set1(1,:), Set1(2,:))
plot(Set2(1,:), Set2(2,:))
plot(Set3(1,:), Set3(2,:))
plot(Set4(1,:), Set4(2,:))
plot(Set4(1,:), CommonLine, '--k')
hold off
Make appropriate changes to get the result you want.
.
  2 件のコメント
deepak maurya
deepak maurya 2021 年 8 月 9 日
Thank you
I will try and accept answer once done.
Star Strider
Star Strider 2021 年 8 月 9 日
My pleasure!
.

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

カテゴリ

Help Center および File ExchangeSpecifying Target for Graphics Output についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by