Stefan, can you confirm this should be done by returning a MatrixToken (which then wraps CharToken's) from the num2str class in the case of a matrix result. For a single result i will simply return a CharToken.
If so then i can create a patch and also update the test cases.
Jason
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=320205
Originator: NO
num2str:
This can return a matrix in matlab. The current code does not allow for this.
Test cases to be included (ignoring whitespace differences):
num2str(49) -> "49"
num2str(49.0) -> "49"
num2str(49.01) -> "49.01"
num2str([ 1 2 3]) -> "1 2 3"
num2str([ 1.0 2.0 3; 4.01 5 6.02]) -> "1 2 3"
"4.01 5 6.02"
Stefan, can you confirm this should be done by returning a MatrixToken (which then wraps CharToken's) from the num2str class in the case of a matrix result. For a single result i will simply return a CharToken.
If so then i can create a patch and also update the test cases.
Jason
Logged In: YES
user_id=320205
Originator: NO
CVS has a patch which uses MatrixToken (which then wraps CharToken's), but the results are not as i expected.
From what i can deduce i think that i need to create a StringToken which holds a vector of CharToken's. Will give that a go.
Logged In: NO
Ok i get it now. Patch to come shortly. Sorry for confusion.
Jason