how I can transform syms to String in java?
이전 댓글 표시
Im trying to make a calculator (for school) where i can integrate, derivative and graph an equation. But when matlab have to return the answer, i get a Exception, i was looking around until i found that matlab turn the answer to "syms" (54*x - 4 for example). So i try to get like an object then turning into string but all i got is " [Ljava.lang.Object;@4b9385". It is there anyway that i can get the syms and turning into a string?
답변 (1개)
Walter Roberson
2015년 9월 18일
char() the syms object. For example,
syms x
result = diff(sin(x) - cosh(x),x);
result_string = char(result);
댓글 수: 2
Oscar Gutierrez
2015년 9월 18일
Walter Roberson
2015년 9월 18일
It appears that you are using http://matlabcontrol.googlecode.com/svn-history/r503/javadocs/doc/matlabcontrol/MatlabOperations.html
If I understand the examples, then
Object[] d = proxy.returningeval("char( int(9*x^3 - 2*x^2,2,x) )", 1);
System.out.println("Result: " + d[0]);
This is consistent with the "returning feval" example at https://code.google.com/p/matlabcontrol/wiki/Walkthrough which is a case that returns a string.
카테고리
도움말 센터 및 File Exchange에서 Common Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!