You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
How to extract the I and Q values from eye-diagram function into separate Variable?
1 view (last 30 days)
Show older comments
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);
Accepted Answer
yanqi liu
on 27 Oct 2021
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 Comments
john karli
on 27 Oct 2021
I want to save the I and Q in seperate variable like.
Could it be possible?
a1(:,:,1) = I;
a1(:,:,2) = Q;
yanqi liu
on 27 Oct 2021
Edited: yanqi liu
on 27 Oct 2021
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');
john karli
on 27 Oct 2021
I am getting the following error
Unrecognized method, property, or field 'XData' for class 'matlab.graphics.GraphicsPlaceholder'.
yanqi liu
on 27 Oct 2021
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');
yanqi liu
on 1 Nov 2021
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
john karli
on 1 Nov 2021
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))
yanqi liu
on 4 Nov 2021
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
john karli
on 4 Nov 2021
i do it according to your instruction but problem is same. please see attach photo
yanqi liu
on 4 Nov 2021
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))
yanqi liu
on 4 Nov 2021
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
john karli
on 4 Nov 2021
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?
john karli
on 5 Nov 2021
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
yanqi liu
on 5 Nov 2021
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
yanqi liu
on 5 Nov 2021
yes,sir,the first row is X in figure Axes,at the same plot status,so them must be equal
More Answers (0)
See Also
Categories
Find more on Debugging and Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)