How to plot 1 point on a graph.
458 次查看(过去 30 天)
显示 更早的评论
Hi guys, ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275781/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275781/image.png)
I'm trying to plot just 1 dot on the graph at x coordinate of 29.08882087 but I'm stuck with it. Could anyone help me with that please? Thank you.
0 个评论
回答(2 个)
Ameer Hamza
2020-3-7
You can pass more inputs to plot function to tell it just to plot a point. For example,
plot(29.08882087, y_coordinate, '.', 'MarkerSize', 30)
replace the value of y_coordinate to specify the location of point on y-axis.
0 个评论
Image Analyst
2020-3-7
Try this:
c = 23892.80076;
k = 4099768.2;
m = 2000;
Y = 0.1;
w = (0:100);
X = Y*((k^2 + (c.*w).^2) ./ ((k-m.*(w.^2)).^2 + (c .* w).^2)).^0.5;
plot(w, X, 'b-', 'LineWidth', 2);
grid on;
xlabel('w', 'FontSize', 15);
ylabel('X', 'FontSize', 15);
% Plot point at w = 29.08882087
w = 29.08882087;
X = Y*((k^2 + (c.*w).^2) ./ ((k-m.*(w.^2)).^2 + (c .* w).^2)).^0.5;
hold on;
plot(w, X, 'r.', 'LineWidth', 2, 'MarkerSize', 25);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/275790/image.png)
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!