How to get curve fitting equation
4 ビュー (過去 30 日間)
古いコメントを表示
Abdallah Magour
2024 年 1 月 23 日
コメント済み: Abdallah Magour
2024 年 1 月 24 日
Is there a way I can get the equation shwon in the figure or in the basic fitting window? The 8th degree polynimial.
I want to get this equation through a code line not through the graph tools, I also need it in the exact same form.(Including x)
I will repeiat this for a large number of plots or x and y data directly if possible.
Please ignore the red line at the bottom.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1598156/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1598156/image.png)
2 件のコメント
akshatsood
2024 年 1 月 23 日
編集済み: akshatsood
2024 年 1 月 23 日
Could you please provide me with the data needed to replicate the issue on my end, allowing me to assist you better?
採用された回答
Walter Roberson
2024 年 1 月 23 日
編集済み: Walter Roberson
2024 年 1 月 23 日
6 件のコメント
Sam Chak
2024 年 1 月 24 日
The data is not the same as what is shown in the image above. However, you can remove the NaN values by utilizing the isnan() function.
T = readtable("Data from a similar graph.xlsx", VariableNamingRule="preserve")
x = T{:,1};
y = T{:,2}; % contains NaN
data= [x, y];
%% Omit row contains NaN
data_clean = data(~isnan(data(:, 2)), :)
%% Extract from clean data
x_clean = data(:,1);
y_clean = data(:,2);
plot(x_clean, y_clean, '-o'), grid on
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Interpolation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!