Remove lines from Touchstone file

2 ビュー (過去 30 日間)
Ashiro Chen
Ashiro Chen 2018 年 1 月 31 日
回答済み: Gaurav Phatnani 2018 年 2 月 2 日
Hi, Matlab experts.
I am working with different Touchstone files (.s4p from a VNA with 4-port S-parameters). My files have some lines above the relevant information I need to use, like this:
!Some comments...
!Date, year...
!Bla, bla, bla
Hz DB R 50 (here starts the relevant information)
I need to remove that lines but I have to do it manually so I want to find a way to do it with a script and some instructions. ¿?
Thank you all!

回答 (1 件)

Gaurav Phatnani
Gaurav Phatnani 2018 年 2 月 2 日
Hi Ashiro,
We do have some functions in the RF Toolbox which will help you extract the required information from Touchstone files.
First you will need to read the Touchstone file into MATLAB using the following command:
data = read(rfdata.data, 'MatlabExampleTouchstoneData.s4p');
Then you can use the ' calculate ' function to derive the power value in dB from the touchstone file you have read.
To calculate the angles you can use the following command:
angleMatrix = angle(data.S_Parameters)*180/pi;

カテゴリ

Help Center および File ExchangeRF Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by