Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Visualizing 3D data

Subject: Visualizing 3D data

From: rpcroke

Date: 3 Mar, 2009 17:46:38

Message: 1 of 3

I've searched all over and I cannot find a satisfactory answer to my
problem.

I have a Nx4 matrix where each row corresponds to an <x,y,z>
coordinate and the 4th value is a 'density' at that point. The data
is already interpolated using radial basis functions. I want to be
able to visualize this using a scatter plot or some sort of surface
rendering. I have tried using scatter3 with the following code and
get the following error:

x = pointset(:,1)';
y = pointset(:,2)';
z = pointset(:,3)';
i = map';
% specify the indexed color for each point
icolor = ceil((i/max(i))*256);
figure;
scatter3(x,y,z,i,icolor);
figure;
scatter3(x,y,z,i,icolor,'filled');

??? Error using ==> patch
Value must be finite and greater than zero.

Error in ==> specgraph.scattergroup.schema>LdoDirtyAction at 145
  refresh(h);

Warning: Error occurred while evaluating listener callback.
> In scatter3 at 88
??? Error using ==> patch
Value must be finite and greater than zero.

Error in ==> specgraph.scattergroup.schema>LdoDirtyAction at 145
  refresh(h);

Warning: Error occurred while evaluating listener callback.
> In scatter3 at 88

I tried using patch with no luck. Can anyone help? This doesn't seem
like it should be this hard.

Subject: Visualizing 3D data

From: us

Date: 3 Mar, 2009 18:14:02

Message: 2 of 3

rpcroke
> scatter3(x,y,z,i,icolor,'filled');
> ??? Error using ==> patch
> Value must be finite and greater than zero...

most likely: your - i - contains negative values...

% show CSSM the output of
     [min(i),max(i)]

us

Subject: Visualizing 3D data

From: rpcroke

Date: 3 Mar, 2009 22:10:09

Message: 3 of 3

On Mar 3, 11:14=A0am, "us " <u...@neurol.unizh.ch> wrote:
> rpcroke
>
> > scatter3(x,y,z,i,icolor,'filled');
> > ??? Error using =3D=3D> patch
> > Value must be finite and greater than zero...
>
> most likely: your - i - contains negative values...
>
> % show CSSM the output of
> =A0 =A0 =A0[min(i),max(i)]
>
> us

It does. I put 0's in and it did not work. Once I put abs( ) it
worked wonderfully. Is there a way to do it with patches or some sort
of surface plotting. The scatter plots get the job done but it
doesn't look as nice as I want.

Thanks,
Ryan

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us