How to import s parameters without RF Toolbox

53 次查看(过去 30 天)
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 个)

Shawn Rogers
Shawn Rogers 2022-1-13
编辑:Shawn Rogers 2022-1-13
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 个评论
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,14:57
For completeness, the easiest solution is to use the sparameters function out of RF Toolbox:

类别

Help CenterFile Exchange 中查找有关 RF Toolbox 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by