Rank: Newbie
Groups: Registered
Joined: 06/08/2016(UTC) Posts: 5
|
Hi everybody, I have a units problems that I can´t solve. Can be a bug? Here is my file. Documento1.sm (30kb) downloaded 17 time(s). Libro2.xlsx (9kb) downloaded 17 time(s).Thanks in advance Regards Eduar Edited by user 06 August 2016 19:13:13(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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) 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" Edited by user 06 August 2016 20:18:27(UTC)
| Reason: marked as SOLVED |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Newbie
Groups: Registered
Joined: 06/08/2016(UTC) Posts: 5
|
Thanks Davide, I´ll try it.
And thank you for the plugin.
Regards
Eduar
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 06/08/2016(UTC) Posts: 5
|
Originally Posted by: Eduardl 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.
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,654 Location: Italy Was thanked: 1340 time(s) in 879 post(s)
|
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 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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
1 user thanked Davide Carpi for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 06/08/2016(UTC) Posts: 5
|
Originally Posted by: Davide Carpi 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 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
EduardI,
If you have to select elements in the vectorise, the Dot function may be the tool... just posted.
Jean
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 06/08/2016(UTC) Posts: 5
|
Jean, thanks for the tip. I'm learning fast thanks to you guys!
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
"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
|
|
|
|
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.