Filter löschen
Filter löschen

DH-Parameters; how to transform sym 4x4 into numeric matrix?

2 Ansichten (letzte 30 Tage)
moinmoinnoob69
moinmoinnoob69 am 22 Nov. 2022
Kommentiert: moinmoinnoob69 am 22 Nov. 2022
Hi guys and girls,
Sry I'm pretty new to MatLab and that seems to be such a basic question and i searched for it in some answered questions, but it didn't work out for me.
So i have this 4x4 symbolic matrix(T0FM) which includes q1(t)... q6(t) which are all sym... looks like that below
I tried it like that, but it doesnt work:
q0num = [0;-pi/2; pi/2;0;0;0];
qd0num = zeros(6,1);
qvec_sym = sym('qsym',[6 1],'real');
qdvec_sym = sym('qdsym',[6 1],'real');
T0FM_num= subs(T0FM,[qvec_sym; qdvec_sym],[q0num;qd0num])
T0FM_num= double(T0FM_num)
Thanks!
  1 Kommentar
moinmoinnoob69
moinmoinnoob69 am 22 Nov. 2022
I think i got it
that qvec_sym and qdevec_sym are nonsense!
it now works with:
q = transpose(arrayfun(@(N) str2sym(sprintf('q%d(t)',N)), 1:6));
qd = transpose(arrayfun(@(N) str2sym(sprintf('q%dd(t)',N)), 1:6));
and fill those in instead of qvec and qdvec
_____________________________________
Can someone prove, that the new T0FM_num is the right Matrix?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by