Can you code A 3D Building in MATLAB?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Gianni Davies
le 11 Jan 2022
Réponse apportée : Kevin Holly
le 11 Jan 2022
Attached you will find a simple Spiral design I made fairly easily using a different coding software Dynamo.
Dynamo has tools which allow 3D models to be made far easier
I am wondering if it is actaully possible to create this shape in MATLAB and, if anyone knows how I would go about coding it in MATLAB it would help me out immesly
My only solution so far is what I would call 'brute force' where I define every co ordinate myself and plot that, but that I vert tedious and if theres a better solution anyone thinks is possibe I would like to try it out.
0 commentaires
Réponse acceptée
Kevin Holly
le 11 Jan 2022
This is the approach I would take.
%preallocate
m = zeros(100,100,100);
m(1,21:80,21:80) = ones(60);
angle = 0.25:0.25:360;
for i = 1:1440
new = imrotate(squeeze(m(1,:,:)),i/4);
win1 = centerCropWindow2d(size(new),size(squeeze(m(1,:,:))));
m(i,:,:) = imcrop(new ,win1);
end
figure
isosurface(m)
view(0,90)
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!