Units don't match problem

Units don't match problem - Messages

#1 Posted: 8/6/2016 1:09:41 PM
Eduardl

Eduardl

0 likes in 5 posts.

Group: User

Hi everybody, I have a units problems that I can´t solve. Can be a bug?

Units

Here is my file.

Documento1.sm (29 KiB) downloaded 35 time(s).

Libro2.xlsx (8 KiB) downloaded 28 time(s).

Thanks in advance

Regards

Eduar
#2 Posted: 8/6/2016 1:42:29 PM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Hello Eduar,

nope, is not a bug; the problem is in your second boolean comparison. You have nested a boolean less or equal in the left argument of a boolean less -> the first returns 0 and 1, then this result is compared with the second argument of the boolean less (and here you were lucky because you got 1 - when you get 0 you can't see the error)

2016-08-06 18_34_31-SMath Studio Desktop - [Documento1.sm].png


You have to use the boolean AND to chain two boolean comparisons

2016-08-06 18_37_51-SMath Studio Desktop - [Documento1.sm_].png


Alternatively it is possible to use the function lelt(3) from the plug-in "Custom Functions"

lelt.gif
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 8/6/2016 1:57:06 PM
Eduardl

Eduardl

0 likes in 5 posts.

Group: User

Thanks Davide, I´ll try it.

And thank you for the plugin.

Regards

Eduar

#4 Posted: 8/6/2016 2:46:02 PM
Eduardl

Eduardl

0 likes in 5 posts.

Group: User

Wrote

Thanks Davide, I´ll try it.

And thank you for the plugin.

Regards

Eduar



Hi Davide, your method works fine. But I still have problems with the resolution of the division.

I don't understand, the result is a vector.

Sorry for the question, I'm a newbie in Smath.

#5 Posted: 8/7/2016 5:25:18 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Don't worry; vectorize() is intended to apply to all the vectors' elements functions normally intended to work with scalars without using loops. In your case you have 2 ways:

1) use the loop; in this case vectorize() is not needed, remove it and everything should works

2016-08-07 10_21_27-SMath Studio Desktop - [Documento1.sm_].png

2) use vectorize(); in this case you have to remove all the references to the matrix elements. Note that in your case you have to pre-process or post-process the elements where Mu doesn't meets the requirements

2016-08-07 10_21_37-SMath Studio Desktop - [Documento1.sm_].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 users liked this post
Eduardl 8/8/2016 3:33:00 PM
#6 Posted: 8/7/2016 8:55:06 AM
Eduardl

Eduardl

0 likes in 5 posts.

Group: User

Wrote

Don't worry; vectorize() is intended to apply to all the vectors' elements functions normally intended to work with scalars without using loops. In your case you have 2 ways:

1) use the loop; in this case vectorize() is not needed, remove it and everything should works

2016-08-07 10_21_27-SMath Studio Desktop - [Documento1.sm_].png

2) use vectorize(); in this case you have to remove all the references to the matrix elements. Note that in your case you have to pre-process or post-process the elements where Mu doesn't meets the requirements

2016-08-07 10_21_37-SMath Studio Desktop - [Documento1.sm_].png



You are right!

Thank you Davide.

I hope I can contribute to the community in the future.

Best regards

Eduar
#7 Posted: 8/9/2016 11:39:29 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

EduardI,

If you have to select elements in the vectorise,
the Dot function may be the tool... just posted.

Jean
#8 Posted: 8/9/2016 11:44:18 AM
Eduardl

Eduardl

0 likes in 5 posts.

Group: User

Jean, thanks for the tip. I'm learning fast thanks to you guys!



#9 Posted: 8/10/2016 12:36:46 AM
Jean Giraud

Jean Giraud

983 likes in 6866 posts.

Group: User

"Jean, thanks for the tip. I'm learning fast thanks to you guys!"
How do you know you are learning fast ? !

This type of indexed construction has many variantes, most useful.
For instance: randomly select reasonable number of data points from
an overpopulated collection to be fitted ...

Jean
  • New Posts New Posts
  • No New Posts No New Posts