フィルターのクリア

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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by