Can you code A 3D Building in MATLAB?

6 次查看(过去 30 天)
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.

采纳的回答

Kevin Holly
Kevin Holly 2022-1-11
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 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by