Question

I have this matlab code:

h1= commscope.eyediagram('SamplingFrequency',sample_rate,'SamplesPerSymbol',sample_rate/B,...
   'SymbolsPerTrace',4,'RefreshPlot', 'on','MaximumAmplitude',1.2);
figure(100)
subplot(2,2,1);
plot(h1);

subplot(2,2,3);
plot(h1)

I want to plot h1 in two subplots but it opens new figures and doesn't put it in the same figure. why does it happen and how can I fix it?

Was it helpful?

Solution

I am not familiar with commscope.eyediagram function, but I think that h1 already creates a plot and not data.

I tried your code with data

h1 = 1:10;

and it worked perfectly.

If my guess is correct, you should get the data from h1 by using one of the get methods. Something like:

data=get(h,'XData');

and then re-write your code like that:

figure(100)
subplot(2,2,1);
plot(data);

subplot(2,2,3);
plot(data)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top