Rank: Newbie
Groups: Registered
Joined: 28/05/2012(UTC) Posts: 2
|
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. File with this problem: length_problem.sm. Edited by moderator 29 May 2012 01:47:38(UTC)
| Reason: Not specified
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 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!" |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 28/05/2012(UTC) Posts: 2
|
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 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
|
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Originally Posted by: ska109 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!" |
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,647 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.zipEDIT(1): now i can see your file 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) ( 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 |
|
|
|
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.