readParam( fileName, paramName )

Reads in parameters from file separated by #'s. The delimiter can be changed.
63 Downloads
Updated 18 Jul 2016

View License

To change the delimiter, you must change the '#' on line 14 to any other character.
% This function will read a file for the requested parameter. This will
% be useful when you forget how your code works and need to tune it
% written by Kevin Sheridan, for use under GPLv3
% INSTRUCTIONS:
% use: value = readParam('fileName.txt', 'parameterName')
% A PARAMETER FILE EXAMPLE:
% param1 #1.3567# unit/explanation
% param2 #-2.7896# m/s (the speed of object X)
% ...

Cite As

Kevin Sheridan (2025). readParam( fileName, paramName ) (https://www.mathworks.com/matlabcentral/fileexchange/58283-readparam-filename-paramname), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Import Data in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0