How do I list only i values of a cross product in a plot.
1 view (last 30 days)
Show older comments
I am totally new to MATlab, I need to plot a cross product that contains a variable. The variable ranges from -15 to 15. I wanted to plot the i,j, and k values of the cross product separately on the domain -15 to 15. What function would I use for this. This is what I tried to do. I apologize for any errors in formatting this question.
x=-15:15;
for i= 1:length(x)
C=[0,0,30];
B=[x(i),0,30];
A=[0,40,30];
O=[0,0,0];
rOA=A-0;
rAB=B-A;
MagTAB=875;
MagAB=sqrt(dot(rAB,rAB));
LAB=rAB/MagAB;
TAB=MagTAB*LAB;
A=cross(rOA,TAB);
end
plot(x(i),A(:,:,1))
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!