How to create a bended cylinder structure stored in a 3D matrix?
    8 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    MSmit
 le 18 Jan 2017
  
    
    
    
    
    Réponse apportée : Jordan Ross
    
 le 24 Jan 2017
            Dear all,
I'm looking for a way to create a zeros(500,500,250) matrix with a bended cylinder inside. The voxels inside the bended cylinder should be 1, and the radius should be 10. I am able to create an cylinder with the surf function but I can't find a way to store it in a 3D matrix. Does someone have a solution?
0 commentaires
Réponse acceptée
  Jordan Ross
    
 le 24 Jan 2017
        Hello,
I would suggest looking at the function "cylinder" because it will return the X, Y, and Z coordinates that you can join together to create a matrix. http://www.mathworks.com/help/matlab/ref/cylinder.html
If you want to get the X, Y, and Z points from the surface plot then you are going to want to store the "surf" to a handle. Then using that handle you can access the properties XData, YData, and ZData to create the matrix.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

