필터 지우기
필터 지우기

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

조회 수: 2 (최근 30일)
moinmoinnoob69
moinmoinnoob69 2022년 11월 22일
댓글: moinmoinnoob69 2022년 11월 22일
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
moinmoinnoob69
moinmoinnoob69 2022년 11월 22일
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?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by