Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Eduardl  
#1 Posted : 06 August 2016 19:09:41(UTC)
Eduardl

Rank: Newbie

Groups: Registered
Joined: 06/08/2016(UTC)
Posts: 5
Man
Argentina

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

Units

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

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 06 August 2016 19:42:29(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,654
Man
Italy
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)

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

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
Offline Eduardl  
#3 Posted : 06 August 2016 19:57:06(UTC)
Eduardl

Rank: Newbie

Groups: Registered
Joined: 06/08/2016(UTC)
Posts: 5
Man
Argentina

Thanks Davide, I´ll try it.

And thank you for the plugin.

Regards

Eduar

Offline Eduardl  
#4 Posted : 06 August 2016 20:46:02(UTC)
Eduardl

Rank: Newbie

Groups: Registered
Joined: 06/08/2016(UTC)
Posts: 5
Man
Argentina

Originally Posted by: Eduardl Go to Quoted Post
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.

Offline Davide Carpi  
#5 Posted : 07 August 2016 11:25:18(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,654
Man
Italy
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

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 consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 08/08/2016(UTC)
Offline Eduardl  
#6 Posted : 07 August 2016 14:55:06(UTC)
Eduardl

Rank: Newbie

Groups: Registered
Joined: 06/08/2016(UTC)
Posts: 5
Man
Argentina

Originally Posted by: Davide Carpi Go to Quoted Post
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
Offline Jean Giraud  
#7 Posted : 09 August 2016 17:39:29(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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
Offline Eduardl  
#8 Posted : 09 August 2016 17:44:18(UTC)
Eduardl

Rank: Newbie

Groups: Registered
Joined: 06/08/2016(UTC)
Posts: 5
Man
Argentina

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



Offline Jean Giraud  
#9 Posted : 10 August 2016 06:36:46(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,866
Canada

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
Users browsing this topic
Guest
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.