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 Center および File ExchangeDisplay Image についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by