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

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 3 Jun 2013
Edited: Azzi Abdelmalek on 3 Jun 2013
out(:,:,1)=[1 1 1]
out(:,:,2)=[1 0 1]

3 Comments

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????
Which voxel?
sia
sia on 3 Jun 2013
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.

Sign in to comment.

Tags

Asked:

sia
on 3 Jun 2013

Community Treasure Hunt

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

Start Hunting!