Defining "2:vector" for roots() function Using Submatrix() function

Defining "2:vector" for roots() function Using Submatrix() function - Syntax error while solving roots() function - Сообщения

#1 Опубликовано: 03.03.2022 01:55:28
GabeJ112

GabeJ112

0 сообщений из 4 понравились пользователям.

Группа: User

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 (5 КиБ) скачан 28 раз(а).

Thanks for the help!
#2 Опубликовано: 03.03.2022 04:46:28
fedeghi

fedeghi

25 сообщений из 112 понравились пользователям.

Группа: User

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.
Immagine 2022-03-03 084316.png

With this different approach, your sm file is going to work properly

rootsfunction-2.sm (7 КиБ) скачан 30 раз(а).

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
Immagine 2022-03-03 085827.png

Bye
#3 Опубликовано: 03.03.2022 23:06:12
overlord

overlord

547 сообщений из 1330 понравились пользователям.

Группа: Moderator

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

2022-03-04_04-57.png
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений