Error using plotv "too many input arguments"
古いコメントを表示
I'm trying to generate a plot using these inputs:
% Particle 1
m1 = 1;
V1 = [2*cosd(45); -2*sind(45)];
% Particle 2
m2 = 2;
V2 = [cosd(45); sind(45)];
% Conservation of momentum and kinetic energy
Vcm = (m1*V1+m2*V2)/(m1+m2);
Vr = V1-V2;
Vrmag = norm(Vr);
Vr_starmag = Vrmag;
x = 0:30:360;
Vr_star = [Vrmag*sind(x); Vrmag*cosd(x)];
%% Outgoing velocity vectors
V1_star = Vcm+(m2/(m1+m2))*Vr_star;
V2_star = Vcm-(m1/(m1+m2))*Vr_star;
figure(1)
plot(V1,'r')
hold on
plot(V2,'b')
plotv(V1_star,'Color',[245/255 121/255 12/255])
plotv(V2_star,'g')
hold off
title('Collision results')
legend('C1','C2','C1^*','C2^*')
xlabel('X')
ylabel('Y')
V1_star and V2_star are both 2x13 matrices while V1 and V2 are both 2x1.
I need orange lines for V1_star so I used the rgb triplet code for orange. When I do this, I get the "too many input arguments". Is there better syntax for this or does plotv not recognize the rgb code? Thanks
Note:
plotv(V2_star,'g')
Returns the correct graph. Therefore it must be a formatting issue.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Entering Commands についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!