fixed points in the plots

9 visualizaciones (últimos 30 días)
hasan s
hasan s el 11 de Abr. de 2021
Comentada: hasan s el 18 de Abr. de 2021
Hi,
I have a program that includes a graph of functions in 3D
I need to fix points on the drawing (show the location of the points on the drawing),
I used
hold on ;
plot (A(1),B(2.1),G(3.021),'r*')
plot (A(0.0001),B(3),G(3.21),'r*')
plot (A(3.654),B(3.1),G(2.15),'r*')
But an error appeared to me...
Error in POINTS (line 45)
plot (A(1),B(2.1),G(3.021),'r*')
if any Prof. can help me ...thanks alot

Respuesta aceptada

Walter Roberson
Walter Roberson el 11 de Abr. de 2021
syms A B G
A, B, and G are created as scalar symbols
f = matlabFunction(sum1m2, 'vars', [A, B, G]);
g = matlabFunction(sum3m4, 'vars', [A, B, G]);
h = matlabFunction(sum5m6, 'vars', [A, B, G]);
f, g, and h are created as numeric functions of three inputs.
plot (A(1),B(2.1),G(3.021),'r*')
plot (A(0.0001),B(3),G(3.21),'r*')
plot (A(3.654),B(3.1),G(2.15),'r*')
You try to index scalar A at 1, which works, giving you back the scalar symbol A .
You try to index scalar B at 2.1, which fails, because you cannot index at non-integers... and if you could do that, you would be indexing past the end of the scalar.
You try to index scalar G at 3.021, which fails, non integer, past the end of the scalar. Is it possible that function g was intended? But function g needs three parameters, not one.
I suspect what you want is
plot ((1),(2.1),(3.021),'r*')
plot ((0.0001),(3),(3.21),'r*')
plot ((3.654),(3.1),(2.15),'r*')
  10 comentarios
Walter Roberson
Walter Roberson el 17 de Abr. de 2021
There are also datatips(), but datatips() automatically move to the closest data point, which I did not think you would want to do.
hasan s
hasan s el 18 de Abr. de 2021
Thanks prof. Walter for this valuable information ... Yes, right now, I just need to hold the points

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Line Plots 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