How to extract the I and Q values from eye-diagram function into separate Variable?

I have .mat file of a signal and i get the eyediagram of that signal. when i look at the workspace its the 1x1Figure. but i need the values. How can i get it. I have attached the .mat file as well. Please assist
a = load("E:\Thesis\3 mod type\frame64APSK100.mat");
a1 = eyediagram(a.frame, 8);

 채택된 답변

clc; clear all; close all
a = load("frame128APSK100.mat");
a1 = eyediagram(a.frame, 8);
a2=get(a1,'Children');
a3=get(a2(1),'Children');
[a3.XData; a3.YData]
a4=get(a2(2),'Children');
[a4.XData; a4.YData]

댓글 수: 25

I want to save the I and Q in seperate variable like.
Could it be possible?
a1(:,:,1) = I;
a1(:,:,2) = Q;
clc; clear all; close all
a = load("frame128APSK100.mat");
a1 = eyediagram(a.frame, 8);
a2=get(a1,'Children');
a3=get(a2(1),'Children');
as(:,:,1) = [a3.XData; a3.YData];
a4=get(a2(2),'Children');
as(:,:,2) = [a4.XData; a4.YData];
figure; plot(as(1,:,1),as(2,:,1)); title('I');
figure; plot(as(1,:,2),as(2,:,2)); title('Q');
I am getting the following error
Unrecognized method, property, or field 'XData' for class 'matlab.graphics.GraphicsPlaceholder'.
sir,may be check the version of matlab, the follows is run demo
clc; clear all; close all
a1 = eyediagram(rand(1024,2), 8);
a2=get(a1,'Children');
a3=get(a2(1),'Children');
as(:,:,1) = [get(a3,'XData'); get(a3,'YData')];
a4=get(a2(2),'Children');
as(:,:,2) = [get(a4,'XData'); get(a4,'YData')];
figure; plot(as(1,:,1),as(2,:,1)); title('I');
figure; plot(as(1,:,2),as(2,:,2)); title('Q');
can you please tell me why figure for I sample is empty?
sir, please use matlab m file to run, do not use web to run.
clc; clear all; close all
a1 = eyediagram(rand(1024,2), 8);
a2=get(a1,'Children');
a3=get(a2(1),'Children');
as(:,:,1) = [get(a3,'XData'); get(a3,'YData')];
a4=get(a2(2),'Children');
as(:,:,2) = [get(a4,'XData'); get(a4,'YData')];
%figure; plot(as(1,:,1),as(2,:,1)); title('I');
%figure; plot(as(1,:,2),as(2,:,2)); title('Q');
disp('---------1----------')
disp(as(:,:,1))
%disp('---------2----------')
%disp(as(:,:,2))
the command display result
---------1----------
1 5
0 0.1250 0.2500 0.3750 0.5000
0.0466 0.2321 0.8748 0.4601 0.0031
I have attached the .mat file, but here the I data contain 0 value.
clc; clear all; close all
a = load("E:\Thesis\SNR-dataset\db30\frame_snr30128APSK001.mat");
a1 = eyediagram(a.frame, 8);
a2=get(a1,'Children');
a3=get(a2(1),'Children');
as(:,:,1) = [get(a3,'XData'); get(a3,'YData')];
a4=get(a2(2),'Children');
as(:,:,2) = [get(a4,'XData'); get(a4,'YData')];
%figure; plot(as(1,:,1),as(2,:,1)); title('I');
%figure; plot(as(1,:,2),as(2,:,2)); title('Q');
disp('---------1----------')
disp(as(:,:,1))
%disp('---------2----------')
%disp(as(:,:,2))
sir,this is my run result
the data is
Have you load .mat file which i uploaded?
Thanks alot problem as in my .mat file
Hellow Liu
Pleae see the attached photo i am facing issue again.
yes,sir,please use the follow:
(1)create *.m file,do not use *.mlx
(2)run the code, and do not close figure
then,watch the data
i do it according to your instruction but problem is same. please see attach photo
sorry,sir,i use 2019 to develop,so please use the follow in 2021
clc; clear all; close all
a = load("frame_snr30128APSK001.mat");
a1 = eyediagram(a.frame, 8);
a2=get(a1,'Children');
ind = [];
for i = 1 : numel(a2)
if isempty(get(a2(i),'Tag'))
ind = [ind i];
end
end
a3=get(a2(ind(1)),'Children');
as(:,:,1) = [get(a3,'XData'); get(a3,'YData')];
a4=get(a2(ind(2)),'Children');
as(:,:,2) = [get(a4,'XData'); get(a4,'YData')];
%figure; plot(as(1,:,1),as(2,:,1)); title('I');
%figure; plot(as(1,:,2),as(2,:,2)); title('Q');
disp('---------1----------')
disp(as(:,:,1))
%disp('---------2----------')
%disp(as(:,:,2))
it works. Can you please tell me what was the problem acctully?
because in 2021 version,it trait legend as a graphic handle,so can not get the data
but in 2019 version,not appear this status
Thanks alot sir, As you can see my attach images i have more then 10 .mat file which i need to get the I and Q saparatll then i want to dave them in seprate .mat file with specefic name how can i do it?
Hi Liu
I am little confused about the I data in eye-diagram. When i plot eyediagram of two different .mat file. and get the I and Q value into sepeate variable.
after watching the value of in two seperate variable. the I data is same and Q data is changing, although the eyediagram is different. My question to you is that why tha I data is not changing when there are two different .mat file
sir,may be close the figure before display. please consider the follow code
clc; clear all; close all
as1=get_data('frame_snr304ASK002.mat');
as2=get_data('frame_snr304ASK031.mat');
close all
% now compare as1 and as2
function as=get_data(mat_file)
close all;
a = load(mat_file);
a1 = eyediagram(a.frame, 8);
a2=get(a1,'Children');
ind = [];
for i = 1 : numel(a2)
if isempty(get(a2(i),'Tag'))
ind = [ind i];
end
end
a3=get(a2(ind(1)),'Children');
as(:,:,1) = [get(a3,'XData'); get(a3,'YData')];
a4=get(a2(ind(2)),'Children');
as(:,:,2) = [get(a4,'XData'); get(a4,'YData')];
%figure; plot(as(1,:,1),as(2,:,1)); title('I');
%figure; plot(as(1,:,2),as(2,:,2)); title('Q');
% disp('---------1----------')
% disp(as(:,:,1))
%disp('---------2----------')
%disp(as(:,:,2))
end
I have use your code but i am surprice why 1st row in both as1 and as2 variable are same. I have attached the as1 abd as2 file please have a look
as1=get_data('frame_snr30128APSK5091.mat');
as2=get_data('frame_snr30128APSK9980.mat');
yes,sir,the first row is X in figure Axes,at the same plot status,so them must be equal
isn't the first rows are in phase quadrature?
yes,sir,i think the first row may be the xtick vector for phase quadrature

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2021년 10월 27일

댓글:

2021년 11월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by