how to do smoothen this graph

2 visualizaciones (últimos 30 días)
NURASYIFA ROSLI
NURASYIFA ROSLI el 26 de En. de 2021
Respondida: Walter Roberson el 26 de En. de 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)')

Respuestas (1)

Walter Roberson
Walter Roberson el 26 de En. de 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)')

Categorías

Más información sobre Specifying Target for Graphics Output en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by