How to extract the I and Q values from eye-diagram function into separate Variable?
1 次查看(过去 30 天)
显示 更早的评论
john karli
2021-10-27
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);
采纳的回答
yanqi liu
2021-10-27
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 个评论
john karli
2021-10-27
I want to save the I and Q in seperate variable like.
Could it be possible?
a1(:,:,1) = I;
a1(:,:,2) = Q;
yanqi liu
2021-10-27
编辑:yanqi liu
2021-10-27
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
2021-10-27
I am getting the following error
Unrecognized method, property, or field 'XData' for class 'matlab.graphics.GraphicsPlaceholder'.
yanqi liu
2021-10-27
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
2021-11-1
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
2021-11-1
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
2021-11-4
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
2021-11-4
i do it according to your instruction but problem is same. please see attach photo
yanqi liu
2021-11-4
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
2021-11-4
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
2021-11-4
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
2021-11-5
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
2021-11-5
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
2021-11-5
yes,sir,the first row is X in figure Axes,at the same plot status,so them must be equal
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Debugging and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)