1 Pages (9 items)
Units don't match problem - Messages
#1 Posted: 8/6/2016 1:09:41 PM
Hi everybody, I have a units problems that I can´t solve. Can be a bug?

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

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
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](/en-US/file/ATmBGx/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](/en-US/file/CBNBPo/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"

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)
You have to use the boolean AND to chain two boolean comparisons
Alternatively it is possible to use the function lelt(3) from the plug-in "Custom Functions"
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
Thanks Davide, I´ll try it.
And thank you for the plugin.
Regards
Eduar
And thank you for the plugin.
Regards
Eduar
#4 Posted: 8/6/2016 2:46:02 PM
WroteThanks 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
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](/en-US/file/FTUWaw/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](/en-US/file/KuFCs3/2016-08-07-10_21_37-SMath-Studio-Desktop---_Documento1_sm___png)
1) use the loop; in this case vectorize() is not needed, remove it and everything should works
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
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
WroteDon'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
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
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
EduardI,
If you have to select elements in the vectorise,
the Dot function may be the tool... just posted.
Jean
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
Jean, thanks for the tip. I'm learning fast thanks to you guys!
#9 Posted: 8/10/2016 12:36:46 AM
"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
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
1 Pages (9 items)
-
New Posts
-
No New Posts