Rotation of Matrix Errors
古いコメントを表示
So I am trying to rotate an output of a matrix multiplication problem in spherical coordinates. I need to rotate my vector u by +45 and -60 degrees and plot them to show the original and rotated vector positions. My code is as follows so far:
clear all
clc
v=[1; 0; 0]
theta=0
rm=[cos(theta) sin(theta) 0; -sin(theta) cos(theta) 0; 0 0 1]
u=rm*v
a1=rotate(u,[1 0 0],45)
a2=rotate(u,[1 0 0],-60)
plot3(u,a1,a2);
-----> when I run my program, Matlab gives me an error of having too many output arguments but I do not understand why or how to fix this issue? I have also tried using the rotate(H,[THETA PHI],ALPHA) function but that tells me that I the number of children isn't of the same axes. I do now know where I am going wrong. Any help would be awesome! I am very new to using Matlab.
回答 (1 件)
Azzi Abdelmalek
2013 年 2 月 24 日
編集済み: Azzi Abdelmalek
2013 年 2 月 24 日
rotate(u,[1 0 0],45)
u should be a handle of your plot
h=plot(u)
rotate(h,[1 0 0],45)
カテゴリ
ヘルプ センター および File Exchange で Process Point Clouds についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!