Why does the "sparameters" function produce an error in MATLAB R2023b when importing data from a Touchstone file that includes a degree symbol?

5 views (last 30 days)
When I use the "sparameters" function from the RF Toolbox to open a Touchstone file that contains a degree symbol (°, ASCII 176) I get the following error:
 
Error using ibisTschk2
Invalid character '�'.
Error in rf.file.touchstone.Data
Error in rf.internal.netparams.AllParameters/readRFFile
Error in rf.internal.netparams.AllParameters
Error in rf.internal.netparams.ScatteringParameters
Error in sparameters (line 91)
            obj = obj@rf.internal.netparams.ScatteringParameters(varargin{:});
The degree symbol is usually present in Touchstone files produced by "Anritsu MS4644B Network Analyzer". This issue was not present in MATLAB R2023a and started in MATLAB R2023b.
Why does the "sparameters" function produce an error in MATLAB R2023b when importing data from a Touchstone file that includes a degree symbol?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Oct 2025 at 0:00
The error occurs because, starting in MATLAB R2023b, RF Toolbox (including "sparameters") uses the official Touchstone 2.0 reader and enforces the standard. Per the standard, degree symbols are not allowed in the comment section, so files containing them trigger an error.
Starting in MATLAB R2024b, you can use "setTouchstoneReader" to configure the Touchstone 2.0 reader to ignore invalid characters in comments. 
setTouchstoneReader('IgnoreComments',false)

More Answers (0)

Categories

Find more on Data Import and Network Parameters in Help Center and File Exchange

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!