Why doesn't Matlab finish the computation ?

I am using the Robotic Toolbox. ( https://petercorke.com/toolboxes/roboticstoolbox/ ) . Here is the following code:
syms d3 theta1 theta2 theta4 theta5 theta6
d3=250;
%L(1) = Link ([ Th d a alph])
L(1)= Link ([theta1 400 0 -pi/2]);
L(2)= Link ([theta2 150 0 pi/2]);
L(3)= Link ([-pi/2 d3 0 0]);
L(4)= Link ([theta4 0 0 -pi/2]);
L(5)= Link ([theta5 0 0 pi/2]);
L(6)= Link ([theta6 250 0 0]);
Rob = SerialLink(L);
T06 = Rob.fkine ([15 30 -pi/2 45 60 75])
And this is the result:
T06 =
[ 2279565664855127950984672116025950403718010560992786282214304830896967169515148723326667230005715321808936742965/9619630419041620901435312524449124464130795720328478190417063819395928166869436184427311097384012607618805661696, -5458143263986549499679399745688795144635304556731209375935389346005314249906059065108514195065585986288597104615/9619630419041620901435312524449124464130795720328478190417063819395928166869436184427311097384012607618805661696, -842230889041014793024658840612336447655086028565445779027860429659048366931215397617551031850765/1067993517960455041197510853084776057301352261178326384973520803911109862890320275011481043468288, -57162685568071684505670007244106768592227006310695482445921969934473321864644681670136903234683225/533996758980227520598755426542388028650676130589163192486760401955554931445160137505740521734144]
[ -451592735219852612222219040893979379272316386085997250626192748562394610934102521166125672961544950405442124795/1202453802380202612679414065556140558016349465041059773802132977424491020858679523053413887173001575952350707712, -964521489443622497330931105121906530755509818840219903483437483513176180376495533383809973672648717613663271895/1202453802380202612679414065556140558016349465041059773802132977424491020858679523053413887173001575952350707712, 61979630473150477553983655029564922425558038880575922134622624060134425758113511468019905784739/133499189745056880149688856635597007162669032647290798121690100488888732861290034376435130433536, -10580611545800814452849775319731868259466928305592106234713230890272914630975358038096267764363625/66749594872528440074844428317798503581334516323645399060845050244444366430645017188217565216768]
[ -478456424623973585812132967565701292984134219077108895934871635577542701194106948289567613361315/533996758980227520598755426542388028650676130589163192486760401955554931445160137505740521734144, 99404531321066874527805350397951643706000442828813873262165036089431672503299958382777478412385/533996758980227520598755426542388028650676130589163192486760401955554931445160137505740521734144, -23902234743072061840821873833421195198470441321704248229872366439766214134658293/59285549689505892056868344324448208820874232148807968788202283012051522375647232, 10012440844640757187562789190005621895661310669524157817429096740842841780029383775/29642774844752946028434172162224104410437116074403984394101141506025761187823616]
[ 0, 0, 0, 1]
As you can see, it doesnt complete the computation and shows it like that on the command window as a result. How can I fix it ?
You can see this video for reference for this toolbox: https://www.youtube.com/watch?v=HvtD1tgpC3s&feature=youtu.be

Answers (1)

MATLAB did complete the calculation. That was the result.
It might be more clear if you use
syms d3 theta1 theta2 theta4 theta5 theta6
Pi = sym(pi);
d3 = 250;
%L(1) = Link ([ Th d a alph])
L(1)= Link ([theta1 400 0 -Pi/2]);
L(2)= Link ([theta2 150 0 Pi/2]);
L(3)= Link ([-Pi/2 d3 0 0]);
L(4)= Link ([theta4 0 0 -Pi/2]);
L(5)= Link ([theta5 0 0 Pi/2]);
L(6)= Link ([theta6 250 0 0]);
Rob = SerialLink(L);
T06 = Rob.fkine ([15 30 -Pi/2 45 60 75])
By the way, I recommend that you document the reason why most of your numbers in the fkine call appear to be in degrees; people are likely to get fairly confused as to why values that look like degrees appear in a call to a function that is working in radians unless you use the 'deg' option (but if you use that option, it would be rather strange to be using -pi/2 degrees...)
Note: if you happen to be expecting a decimal output, then do not use symbolic variables. When you use symbolic variables, you are asking MATLAB to compute indefinitely precise answers, closed form solutions when possible.
If you want to see the decimal approximation of the answer, use vpa()

Asked:

on 30 Nov 2020

Answered:

on 30 Nov 2020

Community Treasure Hunt

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

Start Hunting!