2013-10-24 38 views
0

下面的代碼繪製斷開的矢量,而它們應該彼此接觸。這是一個錯誤還是我錯過了什麼?Matlab函數顫動3 - 矢量斷開

quiver3(0,0,0,50,50,50); 
text(30,30,30,' \leftarrow Views and Eq. returns','FontSize',11, 'FontWeight','bold', 'FontName', 'Palatino Linotype') 
hold on 
quiver3(0,0,0, 50, 50, 0); 
text(30,30,0,' \leftarrow Expected returns (projection/unknows)','FontSize',11, 'FontWeight','bold', 'FontName', 'Palatino Linotype') 
quiver3(50,50,0, 0, 0, 50); 

grid on 

回答

1

我在R2013a中得到了同樣的結果。嘗試尺度參數,即,任選的第七個參數,設置爲等於一個:

figure; 
quiver3(0,0,0, 50,50,50, 1); 
text(30,30,30,' \leftarrow Views and Eq. returns','FontSize',11, 'FontWeight','bold', 'FontName', 'Palatino Linotype') 
hold on 
quiver3(0,0,0, 50,50,0, 1); 
text(30,30,0,' \leftarrow Expected returns (projection/unknows)','FontSize',11, 'FontWeight','bold', 'FontName', 'Palatino Linotype') 
quiver3(50,50,0, 0,0,50, 1); 
grid on 

按照documentation一些爲自動縮放的可被使用。不知道爲什麼默認不是一個。您還可以嘗試通過使用零值的縮放值來禁用縮放 - 這可能對您的應用程序類型更安全。

+0

謝謝你,horchler!加1工作。我的matlab版本是R2011a – user1700890