MATLAB: dealing with java.lang.String

Posted by Jason S on Stack Overflow See other posts from Stack Overflow or by Jason S
Published on 2010-03-22T13:44:41Z Indexed on 2010/03/22 13:51 UTC
Read the original article Hit count: 496

Filed under:
|
|

I seem to be stuck in Kafka-land, with a java.lang.String that I can't seem to use in MATLAB functions:

K>> name

name =

Jason

K>> sprintf('%s', name)
??? Error using ==> sprintf
Function is not defined for 'java.lang.String' inputs.

K>> ['my name is ' name]
??? Error using ==> horzcat
The following error occurred converting from char to opaque:
Error using ==> horzcat
Undefined function or method 'opaque' for input arguments of type 'char'.

how can I get a java.lang.String to convert to a regular MATLAB character array?

© Stack Overflow or respective owner

Related posts about matlab

Related posts about string