Filter löschen
Filter löschen

Can you code A 3D Building in MATLAB?

10 Ansichten (letzte 30 Tage)
Gianni Davies
Gianni Davies am 11 Jan. 2022
Beantwortet: Kevin Holly am 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.

Akzeptierte Antwort

Kevin Holly
Kevin Holly am 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)

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by