how to do smoothen this graph

1 view (last 30 days)
NURASYIFA ROSLI
NURASYIFA ROSLI on 26 Jan 2021
Answered: Walter Roberson on 26 Jan 2021
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)')

Answers (1)

Walter Roberson
Walter Roberson on 26 Jan 2021
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)')

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!