How can I create and manipulate multiple points in MATLAB?

  • Thread starter Thread starter eltrinco
  • Start date Start date
  • Tags Tags
    Matlab Points
Click For Summary
SUMMARY

This discussion focuses on creating and manipulating multiple random points in MATLAB using the rand and randn functions. Users can generate 3D points by executing the command X=rand(3,5), where each column represents the coordinates of a point. To perform transformations, translation can be achieved with X=T*X and rotation with X=R*X, utilizing appropriate transformation matrices. The discussion emphasizes the importance of consulting MATLAB's documentation for built-in functions related to these operations.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of 3D coordinate systems
  • Knowledge of transformation matrices for translation and rotation
  • Basic experience with random number generation in MATLAB
NEXT STEPS
  • Explore MATLAB's built-in functions for matrix operations
  • Learn about transformation matrices in detail
  • Investigate the use of the randn function for generating normally distributed random points
  • Study examples of point rotation and translation in MATLAB
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly students and professionals working in fields such as computer graphics, robotics, and data visualization, who need to create and manipulate random points in a 3D space.

eltrinco
Messages
6
Reaction score
0

Homework Statement


i had some problem with MATLAB of how to create two points of random positions and adding another few random points

Homework Equations


how to create the points, set a point as the centre, make the iteration for one point to rotate the centre and also the other iterations for the rest of the points to rotate each other
 
Physics news on Phys.org
To set random points use the rand or randn functions.
The other operations are translation and rotations - there are matrixes for those.

i.e. 5 3D points at random would be X=rand(3,5) - each column being the coordinates of a point.
The first data point, for eg, is x1=X(:,1)

For a translation T, just do X=T*X
For a rotation R, just do X=R*X

... look up translation and rotation matrixes to see how to make them.
http://en.wikipedia.org/wiki/Transformation_matrix
http://en.wikipedia.org/wiki/Translation_(geometry )

Note: MATLAB has a lot of built infunctions, why not look through the documentation?
 
Last edited by a moderator:

Similar threads

  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 2 ·
Replies
2
Views
11K