fixed points in the plots

3 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2021-4-11
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 个评论
Walter Roberson
Walter Roberson 2021-4-17
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 2021-4-18
Thanks prof. Walter for this valuable information ... Yes, right now, I just need to hold the points

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by