Problem with length() command

Problem with length() command - Сообщения

#1 Опубликовано: 28.05.2012 04:34:39
ska109

ska109

0 сообщений из 2 понравились пользователям.

Группа: User

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.
#2 Опубликовано: 28.05.2012 05:01:40
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,

You get the last math region [MATH=eng]lx_1=length(-1)[/MATH]. 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!"
#3 Опубликовано: 17.06.2012 07:31:07
ska109

ska109

0 сообщений из 2 понравились пользователям.

Группа: User

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



Wrote


Hello,

You get the last math region [MATH=eng]lx_1=length(-1)[/MATH]. 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



#4 Опубликовано: 17.06.2012 07:48:35
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2052 понравились пользователям.

Группа: Moderator

Hello,
Wrote

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!"
#5 Опубликовано: 17.06.2012 08:46:45
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

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

use it in this way:
[MATH]x_1:ToArray(x_1)[/MATH]

EDIT(2): instead of [MATH]x_1:ToArray(x_1)[/MATH] you can use [MATH]x_1:stack(x_1)[/MATH]

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

then you can use:
[MATH]length(x_1)[/MATH]


regards,

w3b5urf3r
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений