フィルターのクリア

How to scat 3D Matrix with value as color

4 ビュー (過去 30 日間)
Arne T
Arne T 2020 年 12 月 10 日
編集済み: Arne T 2020 年 12 月 15 日
Hello,
I have a 3D Array, for e.g.
z = zeros(3,3,3);
z(2,2,2) = 1;
Now I want to Plot this Array with a point for every Number colored for the value.
I made a drawing with paint to underline, what I want:
Thanks!

採用された回答

Arne T
Arne T 2020 年 12 月 15 日
編集済み: Arne T 2020 年 12 月 15 日
I found this solution, but its quik and dirty:
z = zeros(3,3,3);
z(2,2,2) = 1;
x=[];
y=[];
z=[];
for c = 1:size(z,3)
for b = 1:size(z,2)
for a = 1:size(z,1)
x(end+1) = a;
y(end+1) = b;
z(end+1) = c;
end
end
end
scatter3(x,y,z,50,z(:));

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by