[問題] 新手求解

看板MATLAB作者 (Joe mauer)時間10年前 (2014/04/13 23:52), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
x_int=[50:1:250]; y_int=spline(xc,yc,x_int); . . . . thedam(1,i)=(y_int(1,i)-ya)./x_int(1,i); thedam1(1,i)=(L1.^2+(x_int(1,i)-xa).^2+(y_int(1,i)-ya).^2 -L2.^2)/(2*L1*((x_int(1,i)-xa).^2+(y_int(1,i)-ya).^2).^(1/2)); theda1(1,i)=atan(thedam(1,i))+acos(thedam1(1,i)); 在做機構設計,要找出桿件的角度 找到一組參數 thedam=2 thedam1=1.00000 可是代入theda1 求角度的時候會有I值,導致polt不出圖形 theda1=1.10714871779409 + 2.10734242554470e-08i 因為知道acos裡輸入的值 介於 1~-1 也試過 atan(2)+acos(1) 出來為theda1的實部值 實在不清楚虛部從哪來的 請問是哪裡有問題嗎? -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.233.73.32 ※ 文章網址: http://www.ptt.cc/bbs/MATLAB/M.1397404374.A.FA2.html
文章代碼(AID): #1JIhBM-Y (MATLAB)