Clearing and reloading updates form initialization file in a class
조회 수: 3 (최근 30일)
이전 댓글 표시
I'm trying to set the properties of a class by loading the contents of the initialization file (contains user-defined inputs) in a class method.
classdef setting
properties(Constant)
test_graph = settings_utils.data.test_graph;
end
methods(Static)
function data = load_data
I = INI('File','input.ini');
I.read();
data = I.get('UserData'); % struct
end
end
end
example.ini includes the following
[UserData]
test_graph = 'test1'
>> setting.test_graph
gives
'test1'
If the user changes the input in example.ini ('test1' is changed to 'test2'), clear settings followed by setting.test_graph
will return
'test2'.
But I am not sure how this works while creating executables. I have converted my main.m function into a executable using the Application compiler. I want the user to specify inputs (loaded from .ini file in `setting` class), .ini file is not converted into a binary file during compilation (i.e. I have excluded the example.ini file from `Files required for your application to run` tab in the Application compiler.) And the setting class (used in main) and other relevant functions are packaged into an executable.
In this case , I am not sure how the clases are cleared by the executable and how to load the new changes made in .ini in the settings class.
Could someone please give suggestions?
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!