Property_value + Matlab [英] Property_value + matlab
问题描述
对于具有property_value
对的.ini
文件,我想为property_name
定义数据类型,以便根据输入参数数据类型转换数据类型.
For an .ini
file with property_value
pair, I'd like to define the datatype for property_name
such that I will convert the datatype based on the input argument data type .
由于这个原因,我一直试图从ini文件中以struct格式读取特定的数据类型.但是我得到了错误:invalid fieldname
.
For this reason I have been trying to read the specificed datatype from the ini file in struct format. However I am getting the error : invalid fieldname
. How can I define property_name
and datatype such that I'll be able to read it, and also be able to write to the ini file if i'd like to add property_datatype_vlaue
pair?
[system] % string
value
[application] % string
value
我还需要能够从输入参数中设置此数据类型.
I also need tot be able to set this datatype from my input argument.
推荐答案
从 假设:
-
属性名称是合法的Matlab字段名称(有关详细信息,请参见变量命名).
The properties' names are legitimate Matlab field names (see variable naming for details).
每个属性的值始终是一个字符串.
The value of each property is always a string.
在这些示例中,我没有包含任何错误检查代码(找不到文件,格式错误的字符串等)
I did not include any error-checking code in these examples (files not found, wrongly formatted strings, etc.)
我假设输入文件严格是"[prop] val"对,而没有任何其他注释等.
I assume the input file is strictly "[prop] val" pairs without any additional comments etc.
这篇关于Property_value + Matlab的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!