plot rows of a matrix as discrete points

4 ビュー (過去 30 日間)
Bill Symolon
Bill Symolon 2018 年 2 月 1 日
コメント済み: Bill Symolon 2018 年 2 月 1 日
Hopefully, this has a simple solution that I'm just not seeing. I have a basic binary matrix:
if true
x = [0 0; 0 1; 1 0; 1 1];
end
I need to plot each row of this matrix as a discrete point, so that I end up with a dot at each of the four corners.
Then, I need to extend the same process to a 3D plot using the matrix:
if true
% y = [0 0 0; 0 0 1; 0 1 0; 0 1 1; 1 0 0; 1 0 1; 1 1 0; 1 1 1];
end
Thanks for the help!

採用された回答

Birdman
Birdman 2018 年 2 月 1 日
For your first x matrix, type
scatter(x(:,1),x(:,2))
For your 3x3 y matrix, type
scatter3(y(:,1),y(:,2),y(:,3))
  1 件のコメント
Bill Symolon
Bill Symolon 2018 年 2 月 1 日
Birdman, Star, That's perfect, thanks again.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by