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 ska109  
#1 Posted : 28 May 2012 11:34:39(UTC)
ska109

Rank: Newbie

Groups: Registered
Joined: 28/05/2012(UTC)
Posts: 2
Czech Republic

Hi, I have a problem using length() commang.

If used on matrix, it works well, but using the length() command on scalar value (which is, I think, matrix of size 1 by 1), it doesn't work well.

length problem

File with this problem: length_problem.sm.

Edited by moderator 29 May 2012 01:47:38(UTC)  | Reason: Not specified

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

Offline omorr  
#2 Posted : 28 May 2012 12:01:40(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,

You get the last math region lx_1=length(-1). If yoo would use numerical equal to, there would be an error issued.
And, no - scalar is not a matrix of size 1 by 1.

Regards,
Rdaovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline ska109  
#3 Posted : 17 June 2012 14:31:07(UTC)
ska109

Rank: Newbie

Groups: Registered
Joined: 28/05/2012(UTC)
Posts: 2
Czech Republic

Hello,
thank you for your reply. Is trere any other way (instead of using "length()" command) how to find out the number of solutions of the equation?

Thank you for amazing SMath,
kind regards
Jan Skapa



Originally Posted by: omorr Go to Quoted Post

Hello,

You get the last math region lx_1=length(-1). If yoo would use numerical equal to, there would be an error issued.
And, no - scalar is not a matrix of size 1 by 1.

Regards,
Rdaovan


Offline omorr  
#4 Posted : 17 June 2012 14:48:35(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello,
Originally Posted by: ska109 Go to Quoted Post
Is trere any other way (instead of using "length()" command) how to find out the number of solutions of the equation?

Could you be more specific, please?

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Davide Carpi  
#5 Posted : 17 June 2012 15:46:45(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)
Hi,

I don't see your file therefore I'm not sure, but I think that this snippet can help you:

varManager.zip

EDIT(1): now i can see your file Good

use it in this way:
x_1:ToArray(x_1)

EDIT(2): instead of x_1:ToArray(x_1) you can use x_1:stack(x_1) Clap

(x_1 can be an array, a scalar or a text)

then you can use:
length(x_1)


regards,

w3b5urf3r

Edited by user 18 June 2012 12:23:35(UTC)  | Reason: Not specified

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.