function camdesign()clcclear allclose allN_i = input('N de intervalos:');i=1;while(i<=N_i) ibeta_i(i) = input('Beta do intervalo:');L(i) = input('Lift do intervalo:');mov(i) = input('Movimento do intervalo:');i=i+1;endR_0 = input('Raio base:');tb_i=0;tb_f=1;teta=0;passo=0.01;n=1;T(n)=teta;while(i<=N_i) switch mov(i) case 1 while(teta<=beta_i(i)) y=0.5*L(i)*(1-cos(pi*teta/beta_i(i))); dy=((pi*L(i))/(2*beta_i(i)))*sin(pi*teta/beta_i(i)); u=(R_0+y)*sin(teta)+dy*cos(teta); v=(R_0+y)*cos(teta)-dy*sin(teta); T(n)=teta; A(n,:)=[y;dy] P(n,:)=[u;v] n=n+1; teta=teta+passo; end case 2 while(teta<=beta_i(i)) y=L(i)*((teta/beta_i(i))-sin(2*pi*(teta/beta_i(i)))); dy=(L(i)/beta_i(i))*(1-cos(2*pi*(teta/beta_i(i)))); u=(R_0+y)*sin(teta)+dy*cos(teta); v=(R_0+y)*cos(teta)-dy*sin(teta); T(n)=teta; A(n,:)=[y;dy] P(n,:)=[u;v] n=n+1; teta=teta+passo; end end i=i+1; end%figure
%plot(T,A(:,1))
%figure%plot(P(:,1),P(:,2))
end
I can't understand when running why I don't get the values of vectors A and P?
Best Answer