フィルターのクリア

3D Plot with large data

12 ビュー (過去 30 日間)
stephen
stephen 2011 年 2 月 15 日
回答済み: changiz 2014 年 5 月 27 日
Hi, I have a question regarding doing a 3D plot.
I have a 500,000x3 matrix (column A, B, C). Now I want to do a 3D plot by showing A in x-axis and B in y-axis and C in z-axis. I know I could probably use funtion "mesh" to do the plot. But to use the mesh function, I have to use meshgrid function to transform the vectors into matrices. The problem is that since each variable has 500,000 rows, I got an error message "Maximum variable size allowed by the program is exceeded." Anyone has a solution to it or other ways of doing the 3D plot?
Thanks for your help!
Stephen
  2 件のコメント
Oleg Komarov
Oleg Komarov 2011 年 2 月 15 日
Don't recall the post, but you won't need all of the points especially since the amount of pixels on the screen are less...
changiz
changiz 2014 年 5 月 27 日
u can use isosurface ,if you matrix name is mat: isosurface(mat);

サインインしてコメントする。

回答 (3 件)

Jiro Doke
Jiro Doke 2011 年 2 月 15 日
Another thing you could try is to do some interpolation of the data and plot at a lower resolution. As Oleg points out, there's no sense in trying to visualize 500000 points at once. Check out triscatteredinterpclass (or griddata).
F = TriScatteredInterp(M(:,1), M(:,2), M(:,3));
[qx, qy] = meshgrid(linspace(min(M(:,1)), max(M(:,1)), 20), ...
linspace(min(M(:,2)), max(M(:,2)), 20));
qz = F(qx, qy);
mesh(qx, qy, qz);
  1 件のコメント
Walter Roberson
Walter Roberson 2011 年 2 月 15 日
Or gridfit,
http://www.mathworks.com/matlabcentral/fileexchange/8998

サインインしてコメントする。


Walter Roberson
Walter Roberson 2011 年 2 月 15 日
You have not really defined what you want your plot to look like or whether the points are expected to have relationships to adjacent points.
plot3(M(:,1), M(:,2), M(:,3))
scatter3(M(:,1), M(:,2), M(:,3))
  2 件のコメント
stephen
stephen 2011 年 2 月 15 日
Thanks for your quick response, Walter.
Each pair of A and B decides an unique value of C. The plot would like a curved surface. I tried plot3 but looks like the screen froze for a little while then crashed. I guess it was because the data is too big.
Walter Roberson
Walter Roberson 2011 年 2 月 15 日
Sounds like you don't have any structuring of the points. In that case, scatter3() would be better. You could start off with a random sampling of points to see how it goes:
numsamps = 1000;
idx = 1 + floor(size(M,2) * rand(numsamps,1));
scatter3(M(idx,1), M(idx,2), M(idx,3));

サインインしてコメントする。


changiz
changiz 2014 年 5 月 27 日
u can use isosurface ,if you matrix name is mat: isosurface(mat);

カテゴリ

Help Center および File ExchangeScalar Volume Data についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by