1 страниц (5 вхождений)
Function output - Сообщения
#1 Опубликовано: 20.09.2009 13:11:06
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 Опубликовано: 20.09.2009 22:05:49
Not sure I understand. Please, post detailed explanation, maybe I'll implement it.
#3 Опубликовано: 21.09.2009 08:45:07
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 Опубликовано: 21.09.2009 11:11:06
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 Опубликовано: 21.09.2009 11:36:03
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 страниц (5 вхождений)
-
Новые сообщения
-
Нет новых сообщений