Clear Filters
Clear Filters

Grid Data in 3D matrices

1 view (last 30 days)
Hege
Hege on 12 Jul 2020
Commented: Hege on 13 Jul 2020
Hi, I want to get the values of GridInput, GridX,GridY and Grid Z data as the attached First image for my script. I tried a lot and saved my script as save(__.mat file). It does not give above data. second image is my effort and attached code is my own script. Appreciate your kind support as I am new to the matlab.
B=zeros(10,10,10);
for i =1:10;
for j=1:10;
for k=1:10;
if ((i==1)||(i==2)||(i==3)||(i==4)||(i==5)||(i==6)||(i==7)||(i==8)||(i==9)||(i==10))&&((j==1)||(j==10))&&((k==1)||(k==10));
B(i,j,k)=1;
else B(i,j,k)=0;
if((i==1)||(i==10))&& ((j==1)||(j==2)||(j==3)||(j==4)||(j==5)||(j==6)||(j==7)||(j==8)||(j==9)||(j==10))&&((k==1)||(k==10));
B(i,j,k)=1;
else B(i,j,k)=0;
if ((i==1)||(i==10))&&((j==1)||(j==10))&& ((k==1)||(k==2)||(k==3)||(k==4)||(k==5)||(k==6)||(k==7)||(k==8)||(k==9)||(k==10));
B(i,j,k)=1;
else B(i,j,k)=0;
end
end
end
end
end
end
  2 Comments
KSSV
KSSV on 13 Jul 2020
What is that you are trying to do?
Hege
Hege on 13 Jul 2020
I want to view my model using the stl file.But I want to use the function developed in the mathworks website which is shown in the attached link(CONVERT_voxels_to _stl). I have the problem that how they have taken the GridInput,GridX,GridY and GridZ values as shown in First Image of this question. Below image show their example script which means that they have used their example .mat file(to import the GridInput,GridX,GridY and GridZ values to their script).My aim is to find these values in my 3d matrix(Above attached script) and import it to my script.But I am facing the problems in finding these values in my .mat file.

Sign in to comment.

Answers (0)

Categories

Find more on Display Image in Help Center and File Exchange

Tags

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!