- Read about element by element operations.
- You are plotting only one point i.e n = length(x).
- You have not initalized f, g
Plot will not show lines
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Christina Allen
el 2 de Mzo. de 2021
Comentada: KSSV
el 2 de Mzo. de 2021
I'm trying to show multiple lines on a graph but the lines do not show up on the figure.
x = [-0.923 : 0.01 : -0.633] ;
for n = 1 : 1 : length(x)
f(n) = 16*x(n)^3 - 13*x(n)^2 + 12*x(n) + 15
g(n) = -7*x(n)^3 - 6*x(n)^2 + 4*x(n) - 6
end
plot(x,f(n), x,g(n))
ylabel('f(x) and g(x)')
xlabel('x values')
1 comentario
KSSV
el 2 de Mzo. de 2021
Respuesta aceptada
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.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!