Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline sublim21  
#1 Posted : 08 January 2013 02:13:47(UTC)
sublim21


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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 08 January 2013 04:16:16(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,647
Man
Italy
Location: Italy

Was thanked: 1329 time(s) in 875 post(s)
Originally Posted by: sublim21 Go to Quoted Post
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
Users browsing this topic
Guest
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.