vector norms help mat

3 次查看(过去 30 天)
Adriana Mons
Adriana Mons 2019-9-23
编辑: Adam Danz 2019-9-24
Given this code
X = sampleUnitSphere(2, 100);
A = [-2 3;-3 1 ];
AX = A*X;
figure(1); clf; hold on;
plot( X(1,:), X(2,:),'b.');
plot(AX(1,:),AX(2,:),'r.');
legend('Unit 2-ball in R^2', 'Transformation under A')
hold off
axis square equal
If I consider another 2 matrices where B=[ 1 3; 1 1] and C=reshape(1:4,2,2) how do I show the three matrices graphically in one figure using subplot and adding a legend ? the plot where the legend is the following
legend('Unit 2-ball in R^2', 'Transformation under A')
hold off
axis square equal
  1 个评论
Adam Danz
Adam Danz 2019-9-24
编辑:Adam Danz 2019-9-24
Please format your code next time.
What have you tried so far? Why doesn't subplot() and legend() commands solve your problem? FYI, I can't run your code because I don't know what sampleUnitSphere is.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Legend 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by