How to import s parameters without RF Toolbox

Hello,
I have a trouble in reading S-parameters files in Matlab with my current license. Could you please give me an alternative solution?
Best,
Mohammadreza

2 件のコメント

Mohammadreza
Mohammadreza 2018 年 11 月 19 日
Thank you. It works for me.

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

回答 (2 件)

Shawn Rogers
Shawn Rogers 2022 年 1 月 13 日
編集済み: Shawn Rogers 2022 年 1 月 13 日

1 投票

Here is a method that has worked for me for reading an s2p file from a network analyzer. Adjust accordingly for the number of headerlines and S-parameters.
filename = 'testfile.s2p';
numberOfHeaderLines = 5;
FID = fopen(filename);
datacell = textscan(FID,'%f%f%f%f%f%f%f%f%f','Headerlines',numberOfHeaderLines,'CollectOutput',1);
fclose(FID);
A=datacell{1};

3 件のコメント

Simon
Simon 2022 年 3 月 30 日
編集済み: Simon 2022 年 3 月 31 日
Thanks for your sharing. can you tell me how to read an s4p file from a network analyzer.
Kishen Someshwar
Kishen Someshwar 2023 年 8 月 14 日
Hi Shawn,
Do you have an examnple for a s3p file?
Giovanni de amici
Giovanni de amici 2023 年 10 月 16 日
don't need an example.
adjust the "numberOfHeaderLines" constant and the '%f%f%f...' format string according to the details of your own .sNp files, where N=2, 3, 4. any unneeded '%f' becomes a NaN (which is not difficult to remove later on).

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

Idin Motedayen-Aval
Idin Motedayen-Aval 2024 年 11 月 15 日

0 投票

For completeness, the easiest solution is to use the sparameters function out of RF Toolbox:

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

製品

タグ

質問済み:

2018 年 11 月 19 日

回答済み:

2024 年 11 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by