How to Plot Single Points in 3D Space Using MatLab?

In summary, to plot a single point on MatLab, use the <code>plot()</code> function followed by the coordinates of the point. To plot multiple points, pass in arrays of x-coordinates and y-coordinates to the <code>plot()</code> function. The appearance of the plotted points can be customized by adding additional arguments such as shape and color. The axes on a MatLab plot can be labeled using the <code>xlabel()</code> and <code>ylabel()</code> functions, and a title can be added using the <code>title()</code> function.
  • #1
hitachiin69
2
0
This might be an unusual thread but is that i really can't figure out how to plot single points in 3D space using MatLab.

I need to plot the points (1,0,0) , (0,1,0) and (0,0,1)
 
Physics news on Phys.org
  • #2
hitachiin69 said:
This might be an unusual thread but is that i really can't figure out how to plot single points in 3D space using MatLab.

I need to plot the points (1,0,0) , (0,1,0) and (0,0,1)

Do you mean something like that?
View attachment 1966

You can do it,by using the following commands:

>> plot3(1,0,0, '*',0,1,0,'*', 0,0,1,'*')
>> zlim([-2 2])
>> ylim([-2 2])
>> xlim([-2 2])
 

Attachments

  • plot.jpg
    plot.jpg
    11.9 KB · Views: 65

FAQ: How to Plot Single Points in 3D Space Using MatLab?

How do I plot a single point on MatLab?

To plot a single point on MatLab, you can use the plot() function followed by the coordinates of the point. For example, plot(2, 5) will plot a point at (2, 5) on the graph.

How do I plot multiple points on MatLab?

You can plot multiple points on MatLab by passing in arrays of x-coordinates and y-coordinates to the plot() function. For example, plot([1 2 3], [4 5 6]) will plot the points (1, 4), (2, 5), and (3, 6) on the graph.

Can I customize the appearance of the plotted points?

Yes, you can customize the appearance of the plotted points by adding additional arguments to the plot() function. For example, you can specify the color and shape of the points by adding 'o' for circles, '*' for asterisks, or 's' for squares after the coordinates. You can also specify the color by adding 'Color', 'red' after the coordinates.

How do I label the axes on a MatLab plot?

You can label the axes on a MatLab plot by using the xlabel() and ylabel() functions. For example, xlabel('Time') will label the x-axis as "Time" and ylabel('Temperature') will label the y-axis as "Temperature".

Can I add a title to my MatLab plot?

Yes, you can add a title to your MatLab plot by using the title() function. For example, title('Plot of Temperature vs. Time') will add the title "Plot of Temperature vs. Time" to your graph.

Similar threads

Replies
5
Views
1K
Replies
1
Views
1K
Replies
4
Views
1K
Replies
2
Views
3K
Replies
1
Views
1K
Replies
11
Views
3K
Replies
1
Views
5K
Replies
1
Views
2K
Replies
9
Views
4K
Back
Top