Add a voxle a value

hi guys, I want to create a 3D coordinate system, then I want to assign a value of each voxel. e.g. the coordinates [1 1 1] will have the value first.
how can i do something like this?
THX

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 6 月 3 日
編集済み: Azzi Abdelmalek 2013 年 6 月 3 日

0 投票

out(:,:,1)=[1 1 1]
out(:,:,2)=[1 0 1]

3 件のコメント

sia
sia 2013 年 6 月 3 日
ohh my mistake: e.g. the coordinate [1 1 1] should have the value 0.
but i want to iterate for each coordinate.
Like that
function test_environment1(u)
geometry = [5 5 5];
voxelsize = [1 1 1];
%axis([0,x,0,y,0,z])
for x = 1 : 10
for y = 1 : 10
for z = 1 : 10
if (geometry == x && y && z)
% value this voxel equals u
else % value those voxel equals 0
end
end
end
end
end
Can u understand me????
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 6 月 3 日
Which voxel?
sia
sia 2013 年 6 月 3 日
accepted my worldcoordinatesystem has the size(10X10X10), now I want to go through all voxel and add for each voxel the value 0 until this coordinate [5 5 5] is achieved, then I want to add value 1.

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

カテゴリ

タグ

質問済み:

sia
2013 年 6 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by