[gradsusr] GrADS in Matlab
Trevor Porter
tjporter at connect.carleton.ca
Fri Aug 19 12:21:11 EDT 2011
Arlindo,
Answers to your questions:
-I'm using Matlab 7.4 (student version)
-The unzipped jar file is loaded dynamically from the startup.m file
-I removed the unzipped jar files I mentioned before and I get the same
result
Recap:
-I have a folder in the Matlab root directory called 'GrADS'
-Inside that folder is: the jar file, the grads.m file, and a bin folder
containing the latest GrADS executables (for Windows)
-The GrADS and bin folders are both loaded into PATH from startup.m
-The first command ga = grads('grads -lb',0) still gives the same error I
indicated below
Issues:
-I think the problem is in the grads.m file
-If you open grads.m, a big red error flag appears on line 1
-The error flag is associated with the word 'grads' in 'classdef grads <
handle'
-When you place your cursor over the error to get more info, it reads "Class
definition for 'grads' is in an illegal directory (bad @):
C:\Users\owner\Documents\MATLAB\GrADS\grads.m"
Like I said before, I'm not familiar with class definition in Matlab, and
haven't been able to figure the error out on my own. If you have any other
ideas, I would be glad to hear them.
Trevor
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://gradsusr.org/pipermail/gradsusr/attachments/20110819/2552f8db/attachm
ent.html
------------------------------
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
End of gradsusr Digest, Vol 18, Issue 24
****************************************
More information about the gradsusr
mailing list