フィルターのクリア

Rotating 3D data

1 回表示 (過去 30 日間)
태신 김
태신 김 2021 年 11 月 15 日
コメント済み: 태신 김 2021 年 11 月 17 日
I made X, Y coordinates and a triangle with zeros and ones on this plane.
I want to rotate this triangle 45 degrees. I tried rotz(), but I don't have idea to do this.
Thanks in advance.
clc; clear all; close all;
x = linspace(-10,10,49);
y = linspace(-10,10,44);
[X,Y] = meshgrid(x,-y);
Z = zeros(44,49);
Z = importdata('triangle_rotate.txt');
imagesc(Z)

採用された回答

Chunru
Chunru 2021 年 11 月 15 日
clc; clear all; close all;
x = linspace(-10,10,49);
y = linspace(-10,10,44);
[X,Y] = meshgrid(x,-y);
Z = zeros(44,49);
Z = importdata('triangle_rotate.txt');
subplot(121); imagesc(Z); axis equal
Z1 = imrotate(Z, 45);
subplot(122); imagesc(Z1); axis equal
  6 件のコメント
Matt J
Matt J 2021 年 11 月 16 日
You can use the crop option to keep the array the matrix the same size, but there is no guarantee the rotated object will fit inside the original borders:
Z = importdata('triangle_rotate.txt');
Z=imrotate(Z,45,'bicubic', 'crop');
태신 김
태신 김 2021 年 11 月 17 日
Thank you for your helpful answers.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFeature Detection and Extraction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by