Usually I use imagesc to plot the results of my spectrogram function (not the one ot MatLab), because contour is very slow...
In this particular application I would like to plot the results with the x axes in logarithmic scale.
I have used the following code, and it's working:
figure,contour(En,f,S);axis xy
set(gca,'XScale','log')
The same code with imagesc, doesn't work:
figure,imagesc(En,f,S);axis xy
set(gca,'XScale','log')
I don't receive any red error, but just a warning that says "Warning: Negative data ignored"
I think that is a problem with En vector. It is a vector containing the energy in my signal. It is a very little value at the beginning (smaller than 1) and big at the end (bigger than 1).
So, I need logarithm with negative indexes at the beginning: 10^-3 or so on...
Maybe with imagesc I have some trouble in this case? Is there any easy way to awoid this warning?
In fact in the second case I obtain the axes object empty (white), with the xaxis that goes from 10^0 to 10^4, instead than going from 10^-3 to 10^4.
Any suggestions?
Thank you in advance
Is it possible that is due to imagesc need integer values, or something like this?