Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Calling a Java Class in MATLAB

Subject: Calling a Java Class in MATLAB

From: marwen

Date: 26 May, 2010 22:28:06

Message: 1 of 2

Hello friends,
well just i am trying to fellow the same instruction as writing in this page to execute a java class from Matlab:
http://www.mathworks.com/support/solutions/en/data/1-195EX/index.html?product=ML

i did everything but always when i try to execute this command:
o = HelloWorld

i got this error: ??? Undefined function or variable 'HelloWorld'. "
but i try many times to verify if i entered the right path in ClassPath but i found it correct.
By the way can it be a problem with my version of Matlab: 7.0.4.365 (R14) ?

Thank you...

Subject: Calling a Java Class in MATLAB

From: Yair Altman

Date: 27 May, 2010 00:24:05

Message: 2 of 2

"marwen " <hi.marwen@gmail.com> wrote in message <htk79m$s8g$1@fred.mathworks.com>...
> Hello friends,
> well just i am trying to fellow the same instruction as writing in this page to execute a java class from Matlab:
> http://www.mathworks.com/support/solutions/en/data/1-195EX/index.html?product=ML
>
> i did everything but always when i try to execute this command:
> o = HelloWorld
>
> i got this error: ??? Undefined function or variable 'HelloWorld'. "
> but i try many times to verify if i entered the right path in ClassPath but i found it correct.
> By the way can it be a problem with my version of Matlab: 7.0.4.365 (R14) ?
>
> Thank you...

either your class does not have a public no-argument constructor, or it depends on an imported class/package that is NOT in the javaclasspath.

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us