Effacer les filtres
Effacer les filtres

Error using plot comand

2 vues (au cours des 30 derniers jours)
george korris
george korris le 7 Avr 2021
Commenté : george korris le 7 Avr 2021
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)

Réponse acceptée

DGM
DGM le 7 Avr 2021
Modifié(e) : DGM le 7 Avr 2021
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 commentaire
george korris
george korris le 7 Avr 2021
i think this is what i want ,thank you DGM!!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Visual Exploration dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by