Plot of an curve and its equation
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
OLuxanna
el 5 de Nov. de 2022
Comentada: OLuxanna
el 5 de Nov. de 2022
Hello;
I'm trying to get an equation of the plot and before trying to get this I got this plot to see if I can catch it truly and it does.
And here what I ve done till now;
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
a=polyfit(x,y,9);
b=polyval(a,x);
plot(x,y,'ro',x,b)
And What I would like to have is the equation of this plot but once I tried to write the equation with the values from polyfit output I got a plot something completely different. May someone please help me? Thank you so much in advance..
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
c= [214387.3975 -859079.8412 1444444.664 -1323346.187 717335.5313 -233431.4118 44018.3122 -4332.146236 165.7218241 0.584459303];
vel = c.*x';
plot(x,vel,'b','LineWidth',2)
0 comentarios
Respuesta aceptada
VBBV
el 5 de Nov. de 2022
Editada: VBBV
el 5 de Nov. de 2022
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
a=polyfit(x,y,9)
b=polyval(a,x)
plot(x,y,'ro',x,b)
x = 0 : 0.1 : 0.9;
y = [0.584459303
0.496427561
0.351841147
0.269416786
-0.080568348
0.354476019
0.155290021
0.755090485
0.612397011
0.505868478];
c= [214387.3975 -859079.8412 1444444.664 -1323346.187 717335.5313 -233431.4118 44018.3122 -4332.146236 165.7218241 0.584459303];
vel = max(b.*x')
plot(x,vel,'b-','LineWidth',2)
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



