フィルターのクリア

Curve Fitting for multiple plots in single graphs

15 ビュー (過去 30 日間)
Yashvardhan Bhati
Yashvardhan Bhati 2022 年 5 月 12 日
コメント済み: Yashvardhan Bhati 2022 年 5 月 13 日
plot(XCS1,VYS1,'>','MarkerIndices',1:1:100,"LineWidth",2,"Color","Red","MarkerFaceColor","white");
hold on;
plot(XCS2,VYS2,'s','MarkerIndices',1:1:100,"LineWidth",2,"MarkerFaceColor","white");
hold on;
Unrecognized function or variable 'XCS1'.
As a part of code shown above i have to exract data from various files and plot it on one graph. Now this graph has multiple data points correspoing to x and y corrdinates. I want to do curvefitting over all the data point. How do proceed with it.
cftool allows me to fit curve for the single x and y values but i have multiple x's and y's coming from different files.
And after plotting basic curve fitting allows only over single data set i.e. fitting curve for D9 or D10 and not as entire plot.
I have attached image of graph below. for reference.
What i would like to have my graphs look like is shown below the Black line shows the fitted curve.

採用された回答

Matt J
Matt J 2022 年 5 月 12 日
編集済み: Matt J 2022 年 5 月 12 日
Just concatenate the x,y, data.
x=[XCS1(:);XSC2(:)];
y=[VYS1(:);VYS2(:)];
cfit = fit(x,y,fitType)
  1 件のコメント
Yashvardhan Bhati
Yashvardhan Bhati 2022 年 5 月 13 日
Thanks @Matt J. Solution provided works well.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by