Grid Data in 3D matrices

2 次查看(过去 30 天)
Hege
Hege 2020-7-12
评论: Hege 2020-7-13
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 个评论
KSSV
KSSV 2020-7-13
What is that you are trying to do?
Hege
Hege 2020-7-13
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Display Image 的更多信息

标签

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by