How can I convert 100 X Y and Z coordinates generated randomly in the form of a 100x100x100 matrix
古いコメントを表示
close all
clear all
n = 100;
xm = 100;
ym = 100;
zm = 100;
x = 0;
y = 0;
z = 0;
for i=1:1:n
S(i).xd=rand(1,1)*xm;
XR(i)=S(i).xd;
S(i).yd=rand(1,1)*ym;
YR(i)=S(i).yd;
S(i).zd=rand(1,1)*zm;
ZR(i)=S(i).zd;
end
this gives me 100 random x, y and z-axis. I can plot the points but how can i group them as a 3D matrix of 100x100x100 such that matrix entries are (XR(i), YR(i), ZR(i))
4 件のコメント
Tamoor Shafique
2020 年 10 月 30 日
Ameer Hamza
2020 年 10 月 30 日
Each index of 100x100x100 matrix can only contain a scalar value? What do you expect the output at index (XR(i), YR(i), ZR(i))? Do you want these points to be one and the rest of the points to be zero?
Tamoor Shafique
2020 年 10 月 30 日
Matt J
2020 年 10 月 30 日
yes the 100 points should on the 100 should be 1 that would do.
But that is what I gave you below.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!