我是靠谱客的博主 傻傻白云,最近开发中收集的这篇文章主要介绍matlab输入常量,MATLAB中的常量(Constants in MATLAB),觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

I've come into ownership of a bunch of MATLAB code and have noticed a bunch of "magic numbers" scattered about the code. Typically, I like to make those constants in languages like C, Ruby, PHP, etc. When Googling this problem, I found that the "official" way of having constants is to define functions that return the constant value. Seems kludgey, especially because MATLAB can be finicky when allowing more than one function per file.

Is this really the best option?

I'm tempted to use / make something like the C Preprocessor to do this for me. (I found that something called mpp was made by someone else in a similar predicament, but it looks abandoned. The code doesn't compile, and I'm not sure if it would meet my needs.)

最后

以上就是傻傻白云为你收集整理的matlab输入常量,MATLAB中的常量(Constants in MATLAB)的全部内容,希望文章能够帮你解决matlab输入常量,MATLAB中的常量(Constants in MATLAB)所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(44)

评论列表共有 0 条评论

立即
投稿
返回
顶部