Error using plot comand

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by