Rank: Advanced Member Groups: Registered
Joined: 18/05/2011(UTC) Posts: 36
Was thanked: 3 time(s) in 3 post(s)
|
Hey all, I was trying to write a variable type detection script, so i can know if a variable is a number, matrix, string etc. Everything was working until i tried num2str matrices. Most work: num2str(mat("b",1,1)) = However, if an entry in the matrix contains a space or other special character, an error occurs. num2str(mat(" b",1,1)) = **EDIT UPDATE - The original post stated that only leading spaces would result in an error. This is incorrect. Any space in the matrix entry results in an error. Any help in this regard is greatly appreciated. -Pete Edited by user 08 January 2013 19:31:27(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
Originally Posted by: sublim21 Hey all,
I was trying to write a variable type detection script, so i can know if a variable is a number, matrix, string etc.
Everything was working until i tried num2str matrices.
Most work:
num2str(mat("b",1,1)) =
However, if the leading character in the text is a space or other special character, an error occurs.
num2str(mat(" b",1,1)) =
There is no error if the text ends in a space, or other special character.
num2str(mat("b ",1,1)) =
Any help in this regard is greatly appreciated.
-Pete I can confirm (it's a known bug) regards, w3b5urf3r |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.