Use entries of symbolic array outside of the array

1 visualizzazione (ultimi 30 giorni)
I have defined a matrix of symbolic variables via
X=sym(x,[8,24]);
When I now type x5_24 for instance, MATLAB still says "Unrecognized function or variable x5_24". Why? I need to use the variable entries outside of the matrix X.

Risposta accettata

Star Strider
Star Strider il 28 Mar 2020
The reason is that the elements of ‘X’ are stored as matrix elements. The individual elements exist only as matrix elements, not as individual, named variables:
syms x
X=sym('x',[8,24]);
Q = X(5,24)
produces:
Q =
x5_24
  3 Commenti
Tobias Ohrmann
Tobias Ohrmann il 28 Mar 2020
Its a bit complicated, I transported the matrix X to Mathematica, did something with it there and got a new matrix with variables xi_j, which I now want to transport back to MATLAB. So appareantly this was a bad idea..

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by