Create an array containing numeric and symbolic variables
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Connor LeClaire
am 24 Nov. 2021
Beantwortet: Kevin Holly
am 24 Nov. 2021
I am trying to create an array that contains both numeric and symbolic variables. I need both as certain values will be tested if they are symbolic or not using isnumeric(); however, when trying to test these values they all come back as symbolic, is there a way around this? Code below:
syms t1 t2 d;
DH = [0 0.4 0 t1 %i = 1
0 0.1 -90 t2 %i = 2
0 d 90 0]; %i = 3
Thanks!
0 Kommentare
Akzeptierte Antwort
Kevin Holly
am 24 Nov. 2021
syms t1 t2 d;
DH = {0 0.4 0 t1 %i = 1
0 0.1 -90 t2 %i = 2
0 d 90 0} %i = 3
isnumeric(DH{1,1})
isnumeric(DH{1,4})
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!