Is it possible to create a symbolic matrix whose dimensions are symbolic scalar variables?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Zijun
il 7 Lug 2023
Commentato: Walter Roberson
il 7 Lug 2023
Is it possible to create a symbolic matrix whose size is denoted by symbolic scalar variables?
Like this
syms x y
syms z [x y]
where x and y are symbolic scalar variables, and I want to create a symbolic matrix z with a size (x, y).
0 Commenti
Risposta accettata
Walter Roberson
il 7 Lug 2023
Modificato: Walter Roberson
il 7 Lug 2023
No, it is not possible in MATLAB. At the MATLAB level, symbolic arrays are plain arrays of objects, and the arrays have definite size at the MATLAB level.
For reasons I have not worked out yet, symmarray are implemented as having a fixed size even though in a sense they are scalar at the MATLAB level.
2 Commenti
Walter Roberson
il 7 Lug 2023
This is not going to happen for the kind of array that you used. Perhaps at some point it might be supported for symarray
Più risposte (1)
Gandham Heamanth
il 7 Lug 2023
Hi Zijun, here is the small code on how you can create a symbollic matrix whose size is denoted by symbolic scalar variables.
syms x y;
x = 4;
y = 5;
z = sym('z', [x y]);
Vedere anche
Categorie
Scopri di più su Assumptions in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!