help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Isosurface plot


From: \"Niedermayr, Arthur\"
Subject: Re: Isosurface plot
Date: Thu, 04 May 2017 15:35:07 -0400

Hello Mr. Janowski,

to be honest, I think I know what you mean, but I don't understand you thoroughly.

What I mean:
In your example v is a scalar of one combinations of x, y and z.
And v will be recalculated for all possible configurations of x,y and z.
clf;
[x,y,z] = meshgrid (-2:0.5:2, -2:0.5:2, -2:0.5:2);
v = x.^2 + y.^2 + z.^2;

And in my example I assign a value to each combination.

My question is the following:
How can I transform my data, which is a 1D-array, such that I can use the isosurface function?
(I am sure it's possible with the data I have)
Could you maybe post yourself an example how the isosurface function can be used with data from an imported file?

Best regards and thank you very much!
Arthur Niedermayr



-------- Original Message --------
Subject: Re: Isosurface plot
Local Time: May 1, 2017 4:57 PM
UTC Time: May 1, 2017 2:57 PM
From: address@hidden
To: "Niedermayr, Arthur" <address@hidden>
address@hidden <address@hidden>

On Mon, May 1, 2017 at 7:59 AM, "Niedermayr, Arthur" <address@hidden> wrote:


>> M=load ("-ascii", "FERMISURF.OUT")
>>  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]