Effacer les filtres
Effacer les filtres

Grid Data in 3D matrices

2 vues (au cours des 30 derniers jours)
Hege
Hege le 12 Juil 2020
Commenté : Hege le 13 Juil 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 commentaires
KSSV
KSSV le 13 Juil 2020
What is that you are trying to do?
Hege
Hege le 13 Juil 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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Display Image dans Help Center et File Exchange

Tags

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by