This class allows you to create configurations of settings, and to manage them.
The structure of the storage settings is similar to the structure of the storage the settings in the INI-file format.
The class allows you to import settings from the INI-file and to export the settings in INI-file.
Can be used for reading/writing data in the INI-file and managing settings of application.
Evgeny Pr (2021). INI Config (https://www.mathworks.com/matlabcentral/fileexchange/24992-ini-config), MATLAB Central File Exchange. Retrieved .
Inspired: yliu-xjtu/savemultifigs, Satellite Trajectory, ini2struct, Dicom Operator - EsmeProcess
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
I loved the library and made a humble contribution.
I added the capability to parse the strings 'inf', '-inf' or +'inf' as numeric infinity. I suggest you to implement that change too. I did not make it optional although it would be a good idea.
Below is the altered code (just the 'ParseValue' function).
Best regards,
function value = ParseValue(value)
%ParseValue - classify the data types and convert them
% ����������, �������� �� ������ value �� �������� �������
start_idx = regexp(value, '[^\.\s-+,0-9ij]', 'once');
if ~isempty(start_idx)
if all(~strcmpi(value, {'inf', '-inf', '+inf'})) % condition added to allow inifnity to be written as 'inf' on the ini file value
return;
else
warning('inf value detected, parsed as numeric infinity, not as a string."');
end
end
num = StringToNumeric(value);
if ~isnan(num)
value = num;
end
end
Great function! But am I doing it wrong or can SetValues not set ‘String‘?
It is usefull!
Works perfectly.
Really nice tool. I would love to be able to use it for cell arrays though.
working great!!
It works as expected, but I would prefer a better documentation with realistic examples.
Is there a way to write comments in the ini file (i mean from the software with the tools available, not with fwrite..)?
very well