help-octave
[Top][All Lists]

## Re: Isosurface plot

 From: Nicholas Jankowski Subject: Re: Isosurface plot Date: Mon, 1 May 2017 10:57:58 -0400

On Mon, May 1, 2017 at 7:59 AM, "Niedermayr, Arthur" wrote:

>>  isosurface (M(1:end,1), M(1:end,2), M(1:end,3), M(1:end,4), 0.0);

M(1:end,1), M(1:end,2), M(1:end,3) are indicating the first 3 columns, i.e. the x,y,z coordinates, M(1:end,4) indicates the value at the x,y,z coordinate and 0.0 is the isovalue.

I already checked the output of M(1:100,1), I think it should be fine.

But I get the following errors which I don't understand at all:

error: isosurface: V must be a non-singleton 3-dimensional matrix
error: called from
isosurface>__get_check_isosurface_args__ at line 307 column 5
isosurface at line 152 column 42

the issue isn't your first three inputs, but as it says the fourth input (V) should not be a vector. it should be a 3D matrix with values at each intersection of x,y, and z.  Here's a modified version of the first demo (see halfway down this page [1]):

```clf;
[x,y,z] = meshgrid (-2:0.5:2, -2:0.5:2, -2:0.5:2);
v = x.^2 + y.^2 + z.^2;xx = x(1,:,1)(:);yy = y(:,1,1)(:);zz = z(1,1,:)(:);isosurface (xx, yy, zz, v, 1);
axis equal;
title ("isosurface() of a sphere");```

v is still a matrix, not a vector, even though you are specifying x, y, and z as vectors

[1] https://octave.sourceforge.io/octave/function/isosurface.html