vector3d random sample
2 views (last 30 days)
Show older comments
Hi all,
I have a problem plotting some data. There are too many points and therefore I want to plot a random sample.
The class is vector3d and contains 13717 points. I would be interested in plotting around a 1000 points or just a certain percentage. However, I keep getting the following error:
'Error using reshape
Product of known dimensions, 3, not divisible into total number of elements, 13717.'
Hope anyone here can help me.
Cheers,
Rick
0 Comments
Answers (2)
Ameer Hamza
on 18 Jun 2020
Edited: Ameer Hamza
on 18 Jun 2020
vector3d is not a MATLAB class. In case you have data points in the form of n*3 matrix. You can do something like this
M = rand(13717, 3); % for example
idx = randperm(size(M,1), 1000); % select 1000 points from 13717
M_small = M(idx, :); % 1000x3 matrix
3 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!