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 CenterFile Exchange에서 Specifying 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