help-octave
[Top][All Lists]
Advanced

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

Re: Isosurface plot


From: fibonacci4
Subject: Re: Isosurface plot
Date: Fri, 5 May 2017 06:03:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

Am 04.05.2017 um 21:35 schrieb "Niedermayr, Arthur":
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
To: "Niedermayr, Arthur" <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





_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave

Hi Arthur,

please answer below. That is the custom.

Maybe this function in octave helps you:


reshape(A,m,n)

Return a matrix with the specified dimensions (m, n, …) whose elements are taken from the matrix A.

The elements of the matrix are accessed in column-major order (like Fortran arrays are stored).

The following code demonstrates reshaping a 1x4 row vector into a 2x2 square matrix.

reshape ([1, 2, 3, 4], 2, 2)
      ⇒  1  3
          2  4

 Ciao

Karl


reply via email to

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