SMath Studio Forum
»
SMath Studio
»
Questions
»
Newbie problem - Using a range of angles inside a cosine function
Rank: Newbie
Groups: Registered
Joined: 03/10/2012(UTC) Posts: 2 Location: Rugby
|
Hi, I'm trying to convert some old Mathcad files into SMath but am stuck with what must be an elementary problem, I've looked at various tutorials but can't find a solution, no doubt due to my own incompetence. I am defining the following variables: angle:=72 and varangle:= 0, angle/2..360 In Mathcad if I then define: test(varangle):= cos(varangle) the output of test(varangle) displays correctly in a column. If I try the same in SMath I receive either an 'argument must be scalar' or 'fill in all empty elements' error. Thanks for any advice. Screenshots of Mathcad and SMath attached. btw, great software.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 30/03/2011(UTC) Posts: 393
Was thanked: 133 time(s) in 114 post(s)
|
Correct me if i'm wrong, trigonometric functions don't support arrays currently. For now, you can do something like this.
|
1 user thanked kilele for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 03/10/2012(UTC) Posts: 2 Location: Rugby
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/07/2010(UTC) Posts: 437 Location: Beer-Sheva Was thanked: 520 time(s) in 288 post(s)
|
|
1 user thanked Ber7 for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/07/2010(UTC) Posts: 437 Location: Beer-Sheva Was thanked: 520 time(s) in 288 post(s)
|
Regards, Ber7
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 28/09/2024(UTC) Posts: 1
|
Originally Posted by: kilele Correct me if i'm wrong, trigonometric functions don't support arrays currently. For now, you can do something like this. did arrays appear in trigonometric functions?
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 23/12/2011(UTC) Posts: 321 Location: italy Was thanked: 110 time(s) in 94 post(s)
|
now you can use the "vectorize" function, which you also find in the side panel, and perform the trigonometric function element by element. sergio
|
1 user thanked PompelmoTell for this useful post.
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 2,026 Was thanked: 1153 time(s) in 739 post(s)
|
An alternative to the vectorize() function is the use of index vectors. They, however, only work if they are used in a definition. Worksheet1.sm (6kb) downloaded 0 time(s). |
|
1 user thanked mkraska for this useful post.
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Newbie problem - Using a range of angles inside a cosine function
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.