SEAGRID.m with MATLAB R2014b
SEAGRID.m with MATLAB R2014b
Who knows where I can find a version of "seagrid.m" which works with MATLAB R2014b on LINUX 64bit? Since I upgraded from the previous MATLAB version, seagrid crashes with the following error messages:

Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in busy (line 15)
if ~any(findobj('Type', 'figure')), return, end
Error in seagrid (line 101)
busy

Thereafter, I commented out line 15 in "busy.m" and seagrid crashed with

Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in seagrid/doaddmenus (line 27)
if any(h), delete(h), end
Error in seagrid (line 119)
theMenus = doaddmenus(self);

Hence I suppose that there is something wrong with the processing of figure handles in MATLAB R2014b. Any idea?
Cheers,
Reiner

Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in busy (line 15)
if ~any(findobj('Type', 'figure')), return, end
Error in seagrid (line 101)
busy

Thereafter, I commented out line 15 in "busy.m" and seagrid crashed with

Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in seagrid/doaddmenus (line 27)
if any(h), delete(h), end
Error in seagrid (line 119)
theMenus = doaddmenus(self);

Hence I suppose that there is something wrong with the processing of figure handles in MATLAB R2014b. Any idea?
Cheers,
Reiner
Re: SEAGRID.m with MATLAB R2014b
I am having the same problem, kindly let me know if you find a solution.
Thank you
Thank you
Re: SEAGRID.m with MATLAB R2014b
Have you updated your mex files yet? I believe that is my issue, though maybe you have already updated them. From the SEAGRID README.txt in the mex file subdirectory
I have yet to find any for Linux 64 bit.
Code: Select all
Building SEAGRID requires building 3 mex files:
mexsepeli.F
mexrect.F
mexinside.c
These mex files are machine dependent, and can also be matlab version dependent.
...
 CharlesJames
 Posts: 31
 Joined: Thu May 24, 2007 12:12 pm
 Location: South Australian Research and Development Institute
Re: SEAGRID.m with MATLAB R2014b
Seagrid doesn't need to have any mex files in order to run, in spite of the error message, if they are not there seagrid uses m files to perform the same functions. The bigger problem is that starting with Matlab 2014b handles are no longer floating point numbers by default  they have a new class called "handle", Seagrid checks a lot of handle states with the "any" function but this won't work with the new handles  you would probably have start by replacing all "any" statements with "~isempty" to resolve this problem and even if you do that there may still be other issues. I eventually decided to start with the seagrid fast Poisson Solver and recreate the Seagrid functionality in a new standalone executable which is hosted on John Luick's Austides site at http://austides.com/downloads/. We are calling it GridBuilder but is based on the look and feel of Seagrid. At the moment the executable only runs on Windows 64bit machines but you don't need to have Matlab on the machine for it to run.
Re: SEAGRID.m with MATLAB R2014b
Thank you for your reply Charles. A couple of days ago I did switch out all the instances of function "any" to agree with the new r2014b graphics handles but you are right about there still being other issues.
Unfortunately, I am not a Windows machine so I think for now I will just locate an older version of Matlab in order to write grid files but I will be very interested to try your standalone GridBuilder someday.
Unfortunately, I am not a Windows machine so I think for now I will just locate an older version of Matlab in order to write grid files but I will be very interested to try your standalone GridBuilder someday.
Re: SEAGRID.m with MATLAB R2014b
Hi,
I realize this is a pretty old post, but was there ever a solution to this thread? I am trying to get seagrid to work with Matlab 2016b and am having similar errors.
Thanks!
I realize this is a pretty old post, but was there ever a solution to this thread? I am trying to get seagrid to work with Matlab 2016b and am having similar errors.
Thanks!

 Posts: 1
 Joined: Tue Apr 14, 2015 1:27 pm
 Location: University of Western Australia
Re: SEAGRID.m with MATLAB R2014b
jmcsween,
Did you end up resolving the issues with seagrid on matlab2016b? I'm also facing similar issues and wondered if you could advise.
Cheers
Did you end up resolving the issues with seagrid on matlab2016b? I'm also facing similar issues and wondered if you could advise.
Cheers
Re: SEAGRID.m with MATLAB R2014b
No one has updated seagrid. It's too hard and there are other tools.
We keep an old version of Matlab on our system just for this purpose.
We keep an old version of Matlab on our system just for this purpose.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 089018521, USA. ph: 6096300559 jwilkin@rutgers.edu
71 Dudley Rd, New Brunswick, NJ 089018521, USA. ph: 6096300559 jwilkin@rutgers.edu
Re: SEAGRID.m with MATLAB R2014b
I haven't tried GridBuilder, but from the documentation it looks pretty powerful, with SeaGrid's capabilities and then some. And even though available from a consulting company, it's free: http://austides.com/downloads/. If someone tries it, please report back to this thread!
 CharlesJames
 Posts: 31
 Joined: Thu May 24, 2007 12:12 pm
 Location: South Australian Research and Development Institute
Re: SEAGRID.m with MATLAB R2014b
Development on gridbuilder began by trying to fix Seagrid, but the old presto toolbox that was used to drive the gui would also have had to be rewritten so we gave up on that approach  at the heart of Seagrid (and GridBuilder) is the routine rect2grid which uses a fast Poisson solver to generate the interior points of the grid. Our version of this program is called bpsi2grid and is essentially a cleaned up version of rect2grid and doesn't require any mex files and hopefully I've attached it to this post. To form the grid you need to select the boundary points clockwise from the first corner (going the other way around produces weird results), for an m by n grid the vectors for x and y on the boundary need to be 2*((m1)+(n1)) in length with the last boundary point being the last point before the first corner. If the points are evenly spaced between each corner the resulting grid should be pretty good although some grids with telescoping resolution will need some additional cleaning up. Seagrid and Gribuilder essentially provide an interface for defining and transforming those boundary points in a user friendly way and then add on a few bells and whistles for building topography, masks and writing out a ROMS compatible grid file.
 Attachments

 bpsi2grid.m
 GridBuilder version of rect2grid
 (2.66 KiB) Downloaded 196 times
Re: SEAGRID.m with MATLAB R2014b
Dear friends
I am facing the same difficulty with you,and I believe you must have solved this problem with your talent and hardwork.I really hope you can share your experience with me and give me a answer at your convenience.thank you very much!
I am facing the same difficulty with you,and I believe you must have solved this problem with your talent and hardwork.I really hope you can share your experience with me and give me a answer at your convenience.thank you very much!
Re: SEAGRID.m with MATLAB R2014b
I must say the GridBuilder is very powerful!
 CharlesJames
 Posts: 31
 Joined: Thu May 24, 2007 12:12 pm
 Location: South Australian Research and Development Institute
Re: SEAGRID.m with MATLAB R2014b
After some encouragement I have decided to release the full GridBuilder source code and files in the form of a Matlab toolbox. The latest version should run on any version of Matlab 2014b or later. I have only tested it on a Windows machine so I would be interested in hearing how it goes on Macs and Linux. I'm calling this release 1.2 and it includes a new orthogonal grid format suggested by John Wilkin. The grid is constructed like a rectangular grid but rotations, expansions, and translations will try to maintain the 0% orthogonality error of the grid (it will appear slightly distorted on my Cartesian global projection when rotated). Spacing points can be added in Orhtogonal mode but control points are not available as they will change the orhtogonality of the grid. Free Format and Rectangular Format are still available as options. In addition to the new Orthogonal Mode I've tried to incoroporate a help guide within GridBuilder through the toolbox which seems to work. I'll try and continue to provide executable versions of GridBuilder for users who don't have access to Matlab 2014b or higher. John Luick is continuing to host the links to the code so see http://austides.com/downloads for latest versions. We are hoping to have the toolbox hosted through myroms.org as well. The toolbox is quite large as I have packaged the eTopo topography, coastlines, and documentation in one file. Once it is downloaded it should install in Matlab by double clicking on the GridBuilder.mltbx file (from inside Matlab). This will install the code, data, and help files on your matlab path and you should be able to run it by typing GridBuilder at the command prompt.
I have done most of the debugging myself with the help of feedback from users of the executable. I will try to respond to any bug reports as soon as possible so please let me know if you find a problem, even if you fix it yourself! I'm setting up a git repository on github for code only so that will another source for the latest code fixes. Enjoy!
I have done most of the debugging myself with the help of feedback from users of the executable. I will try to respond to any bug reports as soon as possible so please let me know if you find a problem, even if you fix it yourself! I'm setting up a git repository on github for code only so that will another source for the latest code fixes. Enjoy!