|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
function f=handpp(x) %x是一六维数组运行时输入,如x=[90,90,60,1,1.5,0.3]
clc;
clear all;
close all;
th1=x(1)*pi/180;
th2=x(2)*pi/180;
th3=x(3)*pi/180;
L1=x(4);L2=x(5);L3=x(6);
for th1=0:pi/36:2*pi;
for th2=0:pi/36:2*pi;
for th3=0:pi/36:2*pi;
for L1=0:0.1:1.5;
for L2=0:0.1:2;
for L3=0:0.1:1;
A1=[1,0,0,L1;0,1,0,0;0,0,1,0;0,0,0,1];
A2=[cos(th1),0,sin(th1),0;sin(th1),0,-cos(th1),0;0,1,0,1;0,0,0,1];
A3=[cos(th2),0,sin(th2),0;sin(th2),0,-cos(th2),0;0,1,0,L2;0,0,0,1];
A4=[cos(th3),0,sin(th3),0;sin(th3),0,-cos(th3),0;0,1,0,L3;0,0,0,1];
A= A1*A2*A3*A4;
end
end
end
end
end;
end
f=A;
怎么运行是老出现:??? Reference to a cleared variable x.
Error in ==> handpp at 5
th1=x(1)*pi/180;
matlab的参数是如何传递的,我觉得是这样呀。望哪位大虾解答一下,不胜感激。
[ 本帖最后由 nixon003 于 2007-5-30 21:13 编辑 ] |
|