フィルターのクリア

Error using plot comand

2 ビュー (過去 30 日間)
george korris
george korris 2021 年 4 月 7 日
コメント済み: george korris 2021 年 4 月 7 日
Hello guys i have the next code
clc;
clear all;
img = imread('1.jpg');
img = imcrop(img)
Y = abs(fft( mean( imrotate(img,30) ,1) ));
figure
plot(Y)
and when i run it i get the next error does anyone know why?
Error using plot
Data cannot have more than 2 dimensions.
Error in aa (line 8)
plot(Y)

採用された回答

DGM
DGM 2021 年 4 月 7 日
編集済み: DGM 2021 年 4 月 7 日
img = imread('1.jpg');
img is a MxNx3 image. If you expect it to be MxNx1, flatten it in an appropriate manner.
Y = abs(fft( mean( imrotate(img,30) ,1) ));
now Y is a 1xPx3 array. plot() won't know what to do with that. You could squeeze or permute it into 2D
plot(squeeze(Y))
or you could just plot one channel at a time
plot(Y(:,:,1))
  1 件のコメント
george korris
george korris 2021 年 4 月 7 日
i think this is what i want ,thank you DGM!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by