0

I have two figures which have same spaces in domain and range:

enter image description here

and

enter image description here

I follow the manual here about subimage

image1 = imagesc(T*t, F*fs, abs(B));
subimage(T*t, image1);    
image2 = imagesc(T*t, F*fs, abs(B'));
subimage(T*t, image2);    

but I get no picture. Probably, I should use the command infuse instead. I still do not understand how should I should be passing different Y-values and Time-Frequency Representation to the command.

It seems that the command is not designed for three parameters.

How can you make one picture out of two time-frequency plots in Matlab?

Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697

1 Answers1

1

Try

subimage(T*t, F*fs, uint8(abs(B)));

otherwise you are trying to imagesc(T*t), a line

You may need to scale abs(B) to [0,255] if the value in B is out of uint8 range:

B1=abs(B);
B1=B1/max(B1(:))*256; 
subimage(T*t, F*fs, uint8(B1));
lennon310
  • 12,503
  • 11
  • 43
  • 61
  • The values of this **image1 = imagesc(T*t, F*fs, abs(B'));** is integer. So cannot store *imagesc* object that way. I am not sure if *imagesc* is the right way to go. – Léo Léopold Hertz 준영 Dec 31 '13 at 17:57
  • The objects *image1* and *image2* are still integers. So no proper result. – Léo Léopold Hertz 준영 Dec 31 '13 at 18:07
  • No proper result still. – Léo Léopold Hertz 준영 Dec 31 '13 at 18:22
  • that's strange cuz I used B=magic(800) for a test, it seems to work for me – lennon310 Dec 31 '13 at 18:25
  • Please, see this is what I am doing and getting: https://dl.dropboxusercontent.com/u/62073194/Screen%20Shot%202013-12-31%20at%2020.20.01.png I get the same result with your **magic(800)**. I have exactly the same problem here http://stackoverflow.com/questions/20860895/to-make-all-peaks-clearly-visible-in-matlab – Léo Léopold Hertz 준영 Dec 31 '13 at 19:20
  • did you clear all the variables and close all the figures before you started running B=magic(800); and all the rest code? I didn't reproduce your result, and I couldn't find out where is your 10^10 coming from at the y-axis – lennon310 Dec 31 '13 at 19:27
  • I have always **clear all; close all;** in all codes. I managed to see something by having **T = 5000*T** for one figure: https://dl.dropboxusercontent.com/u/62073194/Screen%20Shot%202014-01-01%20at%2012.18.50.png – Léo Léopold Hertz 준영 Jan 01 '14 at 11:22
  • I managed to get things forward here http://stackoverflow.com/questions/20860895/to-make-all-peaks-clearly-visible-in-matlab Can you provide a simple example how you meld two pictures together in Matlab, like vertical and horizontal lines, please. – Léo Léopold Hertz 준영 Jan 01 '14 at 19:19
  • So you don't need subimage any more? I will take a look at your new post now. Thanks – lennon310 Jan 01 '14 at 20:16
  • I do not know if I need subimage or not. I want to plot two images in the same picture. I do not remember how. It should be easy. The following plots for instance only the peaks along the y-axis **imagesc(T*t, F*fs, B); hold on; imagesc(T*t, F*fs, B');** which is not what is intended. – Léo Léopold Hertz 준영 Jan 01 '14 at 21:02