필터 지우기
필터 지우기

Can you code A 3D Building in MATLAB?

조회 수: 10 (최근 30일)
Gianni Davies
Gianni Davies 2022년 1월 11일
답변: Kevin Holly 2022년 1월 11일
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