Error using plot comand
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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)
0 commentaires
Réponse acceptée
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))
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Annotations 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!