現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
 - コミュニケーション基本設定に応じて電子メールを受け取ることができます。
 
How to extract the I and Q values from eye-diagram function into separate Variable?
    4 ビュー (過去 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
  yanqi liu
      
 2021 年 11 月 6 日
				yes,sir,i think the first row may be the xtick vector for phase quadrature
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)
 

