SMath Studio Forum
»
SMath Studio
»
Bugs & Problems
»
Defining "2:vector" for roots() function Using Submatrix() function
 Rank: Newbie
Groups: Registered
Joined: 25/02/2022(UTC) Posts: 4  Location: US
|
Hello, I have run into an issue with putting variables to use in the roots() function by sourcing said variables from a "bank" of variables using the submatrix() function. The roots() function gives a "syntax error" because it does not recognize variables pulled from a larger matrix. rootsfunction.sm (6kb) downloaded 8 time(s).Thanks for the help!
|
|
|
|
  Rank: Advanced Member Groups: Registered
Joined: 14/09/2013(UTC) Posts: 87  Was thanked: 23 time(s) in 15 post(s)
|
Hi, I remember I ran in similar problem and couldn't figure out what was happening.. Maybe our PRO users and developers will find the reason. On the other hand if submatrix is not going to work properly, you could use the "range" syntax to extract the desired submatrix elements. This "ranged" syntax asks more or less the same kind of parameters, and it will work. I suggest to take a look at remarkable mkraska handbook: there are some other examples that show how to handle matrix and submatrix just playing with ranges and vectors in the matrix indexes. See screenshot of his submatrix help page, so that you don't need to dig into the handbook right now.  With this different approach, your sm file is going to work properly rootsfunction-2.sm (8kb) downloaded 11 time(s).Now something which maybe will be a hint for developers (hopefully). I wanted to see what the result of submatrix looked like in a different way, so I tried to convert it to a system. I'm getting a quite unexpected result indeed. If i convert my var.3 with same approach, I obtain a regular "clean" system. Hope this does help  Bye Edited by user 03 March 2022 11:01:39(UTC)
| Reason: added mat2sys check
|
|
|
|
  Rank: Advanced Member Groups: Registered
Joined: 23/07/2013(UTC) Posts: 960  Was thanked: 395 time(s) in 262 post(s)
|
When submatrix() is converted to and from string, it works. Can it be the string decode bug (TermsConverter.DecodeText)? Submatrix is an embedded command, I couldn't check it. Regards 
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Bugs & Problems
»
Defining "2:vector" for roots() function Using Submatrix() 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.