如何在 Octave 中使矩阵(或变量)只读?
我使用 fgetl
从 CSV 加载矩阵,并希望确保它不会改变。
设置值后如何使矩阵(或任何变量)只读?
I load the matrix from a CSV using fgetl
, and want to make sure that it doesn't change.
How to make the matrix (or any variable) read-only after the values are set?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不使用八度音程,但我看到它现在有类,如果它像在 Matlab 中那样,我就会使用类属性。
来自 matlab 帮助:
我不知道 Octave 与 Matlab 有多少不同,但我读到它们没有太大不同,所以也许你可以看看这是否适用于 Octave。
但是,如果您真的担心数据不会被错误地更改,那么您可以将其保留在磁盘上,并在每次想要处理或查看它时读取它。
除非数据量很大,否则现在这不应该成为问题。
I do not use octave, but I see that it has classes now, if it is anything like In Matlab, i'd then use class property.
From matlab help:
I do not know how much different Octave from Matlab, but I read they are not much different, so may be you can see if this works on Octave.
But if you are really worried about your data not changing by mistake, then you can just leave it on disk, and read it each time you want to process or look at it.
Unless it is huge data, this should not be an issue these days.