[gradsusr] GrADS in Matlab

Arlindo da Silva dasilva at alum.mit.edu
Fri Aug 19 11:17:25 EDT 2011


On Fri, Aug 19, 2011 at 9:37 AM, Trevor Porter <tjporter at connect.carleton.ca
> wrote:

> Dear Arlindo:****
>
> ** **
>
> I’ve been trying to run GrADS in Matlab, but haven’t had much success with
> the instructions you gave to another person in my shoes last year (
> http://gradsusr.org/pipermail/gradsusr/2010-November/011915.html).  Here’s
> a summary of what I’ve done so far:****
>
> **
>

Make sure this points to these instructions:

http://opengrads.org/wiki/index.php?title=JyGrADS:_Java_and_Matlab_interface_to_GrADS_through_Jython


> **
>
> 1) I confirmed that Java Virtual Machine is installed and running on my
> computer.  This can be done from the command line in Matlab using the
> following command: javachk(‘jvm’);****
>
> ** **
>
> 2) I downloaded the jygrads-superpack.jar and unzipped it into a directory I created ‘GrADS’ using the command: unzip jygrads-superpack.jar; This extracted 6 folders (com, javatests, jxxload_help, Lib, META-INF, and org).****
>
> **
>
>
Although this may cause no harm, do not unzip. Keep the jar intact as this
is how I tested it.



> **
>
> 3) I added the following 2 lines to my startup file:  path('c:\Users\owner\Documents\MATLAB\GrADS',path);
> javaaddpath('c:\Users\owner\Documents\MATLAB\GrADS\jygrads-superpack.jar');
> ****
>
> ** **
>
> 4) I downloaded the latest GrADS binary file for Windows (which was
> designed for CYGWIN), and untarred it inside the GrADS directory I created.
>
>

Unless you are doing tricky DLL stuff, the fact that cygwin is involved
should not matter. Jygrads talks to grads through pipes, no dynamic linking
involved. This is the same method used by pygrads which does work under
windows.


> This created a ‘bin’ folder with all the GrADS executables.****
>
> **
>

Oops, I never tested this under windows. It should work though, but I never
tried it.


>  **
>
> 5) I created the grads.m file you posted online (
> http://opengrads.org/devel/jygrads/) and saved it to my GrADS directory.**
> **
>
> ** **
>
> 6) I then tried to start GrADS using the commands you provided: ga = grads('grads -lb',0); However, this command did not work, and I was given an error which I cannot figure out:****
>
> ** **
>
> ??? Error: File: grads.m Line: 1 Column: 10****
>
> A class definition must be in an "@" directory.****
>
> **
>

Which version of Matlab do you have?


> **I am not familiar with class definition in Matlab, and haven’t been able
> to figure it out using the help files.  If you can help me troubleshoot this
> problem, I would be most grateful.****
>
> **
>

Classes and objects in matlab are afterthoughts, kind of clumsy. This is the
reason why I have converted my stuff to run with pylab under python. It
appears that the jar is not being read properly. It could also be a matlab
version issue. I also need to know which metthod you used to install the jar
(unzipped): dynamically or statically?

And please, send questions like these to the list.

   Arlindo

**
>
> Best regards,****
>
> Trevor****
>
> ** **
>
> Trevor J. Porter, Ph.D. Candidate****
>
> Carleton University Paleoecology Laboratory****
>
> Department of Geography and Environmental Studies****
>
> 1125 Colonel By Drive****
>
> Ottawa, Ontario****
>
> Canada K1S 5B6****
>
> 613-520-2600 ext. 1836****
>
> http://tjporter.webs.com/****
>
> ** **
>



-- 
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110819/2552f8db/attachment-0003.html 


More information about the gradsusr mailing list