1 Pages (5 items)
Function output - Messages
#1 Posted: 9/20/2009 1:11:06 PM
Not to sure how it is coded, but would it be possible to explicitly state the output variable within a function.
For instance
func(a,b):=some complicated stuff which ends up in M
M=
For instance
func(a,b):=some complicated stuff which ends up in M
M=
#2 Posted: 9/20/2009 10:05:49 PM
Not sure I understand. Please, post detailed explanation, maybe I'll implement it.
#3 Posted: 9/21/2009 8:45:07 AM
https://smath.com/wiki/GetFile.aspx?File=gregpics%5csunday_insert_problem.zip
for example. The procedure to insert a row works, but the function doesn't because you can't explixitly return the answer.
Something like ans:=B would be the way i'd expect to do it, where ans is a reserved word like in Matlab
for example. The procedure to insert a row works, but the function doesn't because you can't explixitly return the answer.
Something like ans:=B would be the way i'd expect to do it, where ans is a reserved word like in Matlab
#4 Posted: 9/21/2009 11:11:06 AM
Wrotehttps://smath.com/wiki/GetFile.aspx?File=gregpics%5csunday_insert_problem.zip
for example. The procedure to insert a row works, but the function doesn't because you can't explixitly return the answer.
Something like ans:=B would be the way i'd expect to do it, where ans is a reserved word like in Matlab
This is, actually, the possibility to make Mathcad-like multiline functions with "line" (extension of SMath programing capability). It is on my "wishlist" as well. I really do not have the slightest idea how complicated could that be to implement in SMath, considering differences between SMath and Mathcad.
As far as I know (hope I am right) the only way to define a function in more then one line (just visually) is with "if":
[MATH]func(x)←if(x≤5;5;x)[/MATH]
[MATH]func(2)=5[/MATH]
[MATH]func(10)=10[/MATH]
Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#5 Posted: 9/21/2009 11:36:03 AM
other syntax suggestions, these would go as the last line in a multiline function
I don't really have a preference, although B= is probably a bit weird.
B=
return(
B
I don't really have a preference, although B= is probably a bit weird.
1 Pages (5 items)
-
New Posts
-
No New Posts