how to do smoothen this graph

2 ビュー (過去 30 日間)
NURASYIFA ROSLI
NURASYIFA ROSLI 2021 年 1 月 26 日
回答済み: Walter Roberson 2021 年 1 月 26 日
this is my coding.
f=5000;
C=[2.000 1.000 0.665 0.500 0.400];
Xc=[15 30 48 58 76];
%% a
data=C*10^-6*f
eq=1./data
%% b
figure
subplot(4,4,[(1,2);(5,6)])
p=polyfit(C,Xc,2)
f=polyval(p,C);
f2=p(1)*C.^2+p(2)*C+p(3)
plot(C,Xc,'o',C,f,'--')
axis([0 2 10 80]);
legend('Experiment Data','Polynomial Fitting', 'Location','northeast')
xlabel('C(\muF)')
ylabel('XC(\Omega)')

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 1 月 26 日
f=5000;
C=[2.000 1.000 0.665 0.500 0.400];
Xc=[15 30 48 58 76];
%% a
data=C*10^-6*f
data = 1×5
0.0100 0.0050 0.0033 0.0025 0.0020
eq=1./data
eq = 1×5
100.0000 200.0000 300.7519 400.0000 500.0000
%% b
figure
subplot(4,4,[1,2;5,6])
p=polyfit(C,Xc,2)
p = 1×3
37.4192 -125.1775 115.8899
Cinterp = linspace(min(C),max(C));
f = polyval(p, Cinterp);
f2=p(1)*C.^2+p(2)*C+p(3)
f2 = 1×5
15.2118 28.1316 49.1946 62.6560 71.8060
plot(C, Xc, 'o', Cinterp, f, '--')
axis([0 2 10 80]);
legend('Experiment Data','Polynomial Fitting', 'Location','northeast')
xlabel('C(\muF)')
ylabel('XC(\Omega)')

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by