Plotting Points from Cells

조회 수: 11 (최근 30일)
John Paul Donlon
John Paul Donlon 2012년 11월 14일
I have a 10000x1 cell array. Each cell holds a 1x3 matrix with the x,y, and z coordinates of a point. How can I plot the points? Thank you in advance.

채택된 답변

Matt J
Matt J 2012년 11월 14일
편집: Matt J 2012년 11월 14일
C = num2cell(cell2mat(yourcell),1);
plot3(C{:}) %or scatter3(C{:})

추가 답변 (1개)

Matt Fig
Matt Fig 2012년 11월 14일
편집: Matt Fig 2012년 11월 14일
Say your cell array is called C, like this:
C = cellfun(@(x) rand(1,3),cell(1000,1),'Un',0);
Now we can plot the points as this:
L = cellfun(@(x) line(x(1),x(2),x(3)),C);
set(L,'marker','o','markersize',3,'markerfac','b')
view(3)

카테고리

Help CenterFile Exchange에서 Computational Geometry에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by