Property_value + Matlab [英] Property_value + matlab

查看:145
本文介绍了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按字母顺序排列属性-值对

推荐答案

假设:

  1. 属性名称是合法的Matlab字段名称(有关详细信息,请参见变量命名).

  1. 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆