Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Why does Matlab create weird Java Strings?

조회 수: 1 (최근 30일)
Michael Sohl
Michael Sohl 2015년 8월 7일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi
I am working on a program which is a Matlab script and I have incorporated a Java program into it. I have created a Vector of Strings in matlab and am trying to use it in the formentioned Java program.
I have used:
vector = java.util.Vector
vector.add('a string')
JavaClass(vector) # constructor
The string that appears in my java program is of type Ljava/lang/String. As I've understood it, this a String is represented in an Array. Is this true? And if so, how do I get a pure java.lang.String into my java program? Or can I go around this problem and change the definition of my input parameter in the constructor?

답변 (1개)

Varun Bhaskar
Varun Bhaskar 2015년 8월 11일
Hello Michael,
Can you elaborate on your question? If you are trying to convert a Java string into a MATLAB character array you can do the same by referring the section 'Converting to the MATLAB char Type' in the following documentation link:
  댓글 수: 1
Michael Sohl
Michael Sohl 2015년 8월 12일
편집: Michael Sohl 2015년 8월 12일
Thanks for answering but the fault didn't lie in Matlab to begin with. I found the origin of the problem so my question wasn't an issue.

이 질문은 마감되었습니다.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by