Get frequency from sparameter object

15 ビュー (過去 30 日間)
Frederikke Johansson
Frederikke Johansson 2020 年 2 月 26 日
回答済み: Payas Bahade 2020 年 3 月 17 日
I have imported a touchstone file (s2p) to an sparameter object using sparameters function in RF Toolbox:
Example_s_param=sparameters('Example.s2p');
I want to get the frequency vector from Example_s_param. I can see it when using disp(Example_s_param) - then it returns:
NumPorts: 2
Frequencies: [1001×1 double]
Parameters: [2×2×1001 double]
Impedance: 50
I want to save the "Frequncies" in a new vector I can use to plot stuff. Somehow I cannot figure out how to do this.
  2 件のコメント
Dennis Hoffmann
Dennis Hoffmann 2020 年 3 月 16 日
its an object.
freq = Example_s_param.Frequencies;
Frederikke Johansson
Frederikke Johansson 2020 年 3 月 17 日
That works - thank you!

サインインしてコメントする。

採用された回答

Payas Bahade
Payas Bahade 2020 年 3 月 17 日
Hi Frederikke,
Example_s_param’ is a structure with 4 fields viz. NumPorts, Frequencies, Parameters and Impedance. To access values in these fields, dot notation is used. For example:
S = sparameters('default.s2p');
Freq = S.Frequencies; % Storing 'Frequencies' field values from Structure 'S' into variable Freq
You can use following code to store frequencies as new vector:
Freq = Example_s_param.Frequencies;
For more details on accessing data in structure array, please refer this documentation.
Hope this helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Network Parameters についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by