How to import s parameters without RF Toolbox

51 Ansichten (letzte 30 Tage)
Mohammadreza
Mohammadreza am 19 Nov. 2018
Beantwortet: Idin Motedayen-Aval am 15 Nov. 2024 um 14:57
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

Antworten (2)

Shawn Rogers
Shawn Rogers am 13 Jan. 2022
Bearbeitet: Shawn Rogers am 13 Jan. 2022
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 Kommentare
Kishen Someshwar
Kishen Someshwar am 14 Aug. 2023
Hi Shawn,
Do you have an examnple for a s3p file?
Giovanni de amici
Giovanni de amici am 16 Okt. 2023
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).

Melden Sie sich an, um zu kommentieren.


Idin Motedayen-Aval
Idin Motedayen-Aval am 15 Nov. 2024 um 14:57
For completeness, the easiest solution is to use the sparameters function out of RF Toolbox:

Kategorien

Mehr zu RF Toolbox finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by