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 frapuano  
#1 Posted : 25 August 2010 22:36:20(UTC)
frapuano


Rank: Advanced Member

Groups: Registered
Joined: 01/08/2010(UTC)
Posts: 115
Man
Italy
Location: Rome

Was thanked: 13 time(s) in 13 post(s)
Hi,

I am starting since a few weeks to use Smath Studio and I like it a lot.
In the hoping to understand it better I am testing some functions, the example attached is related to the Random function that in my modest opinion exhibits a strange behaviour as you can see below:



It looks like that at each assignment the function value that I have evaluated at the beginning and put in the vector M is evaluated again ( not in the vector but on the right side of the equal symbol) .
This way we have the illusion to assign something that is static/costant and this is not true Sad .

Don't know if this is by design but my feelings having used it in Excel or in other application is that its valus need to change only when I press the recalculate button ( and has to change everywhere at the same way ) and not at each assignement of a value that is linked to it.

Hope that I have explained correctly this issue.

Best regards

Francesco

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

Offline omorr  
#2 Posted : 25 August 2010 23:08:22(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello Francesko,

Solution of this is simple. You can define your variable M this way (using "eval" function):
M←eval(mat(random(10),random(10),random(10),1,3))
or to use originaly defined:
M←mat(random(10),random(10),random(10),1,3)
and right click on it and choose Optimization=>Numeric. In either way you will get a set of data that will not change during the subsequent use:
M=mat(9,2,5,1,3)
M=mat(9,2,5,1,3)
M=mat(9,2,5,1,3)
If you want another random data set, just recalculate page (F9) as you requested:
M=mat(5,2,3,1,3)
M=mat(5,2,3,1,3)
x←M
x=mat(5,2,3,1,3)

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
Offline Andrey Ivashov  
#3 Posted : 26 August 2010 00:20:09(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Radovan is absolutely right. It is because random function defined inside the Numeric Library of SMath Studio and cannot be implicitly called by Symbolic Engine (by default all definitions are proceeds with Symbolic Library nor Numeric one).

To see it with your eyes just try to hover M variable definition with a mouse cursor (when math region is not in focus) - you'll see a Tip with current symbolic expression representation and it will have random(..) functions in the matrix cells instead of numbers.

Regards, Andrey Ivashov.
Offline frapuano  
#4 Posted : 26 August 2010 08:55:03(UTC)
frapuano


Rank: Advanced Member

Groups: Registered
Joined: 01/08/2010(UTC)
Posts: 115
Man
Italy
Location: Rome

Was thanked: 13 time(s) in 13 post(s)
Radovan,Andrey,

thanks a lot for your prompt replay, now everything is clear . It is clear too that I have missed the basic of the way of operating of the program and the next time will be much more carefull in using it and will not start immediately to fire questions.

Thanks again

Francesco
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.