Undefined function 'diff' for input arguments of type 'cfit'.

2 ビュー (過去 30 日間)
Yash Mistry
Yash Mistry 2020 年 8 月 11 日
編集済み: KSSV 2020 年 8 月 11 日
% How do I differentiate the f function so as to get a change in slope graph.
L = 152.4;
b = 76;
d = 12.5;
data = readmatrix('H-3point_63_1.csv');
displacement = data(:,2);
force = data(:,3);
% Cleaning the Data
corr_val = find(force<0|force==0);
if corr_val>0
val = max(corr_val)+1;
else
val = 1;
end
% Plotting Raw Data
plot(displacement(val:end),force(val:end),'-or')
xlabel('Displacement (mm)')
ylabel('Force (kN)')
% Finding and plotting peak force
peakforce = max(force(val:end));
A = find(force == peakforce);
B = max(A);
hold on
plot(displacement(B),force(B),'r*')
% Flexural Strength
sigma = 3*peakforce*L/(2*b*(d^2));
% Curve Fitting
f=fit(displacement(val:end),force(val:end),'poly6');
plot(f,'b')
% Slope
df = diff(f);
  1 件のコメント
Yash Mistry
Yash Mistry 2020 年 8 月 11 日
I have used the MATLAB addon called Curve Fitting. Please help me with this small doubt.
Thank you so much.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 8 月 11 日
編集済み: KSSV 2020 年 8 月 11 日
<https://www.mathworks.com/help/curvefit/sfit.differentiate.html>
differentiate() not diff()
You will need to pass in the locations to differentiate at.

カテゴリ

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