MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   MATLAB:处理java.lang.String (https://www.labfans.com/bbs/showthread.php?t=23233)

poster 2019-12-10 20:30

MATLAB:处理java.lang.String
 
我似乎被卡夫卡国困住了,但我似乎无法在MATLAB函数中使用它:

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'. 如何获取java.lang.String转换为常规MATLAB字符数组?



[B]回答:[/B]

Matlab不知道如何处理任何东西,但它是自己的结构。

将字符串转换为char:

cName = char(name);



[url=https://stackoverflow.com/questions/2492646]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 03:00

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.