如何处理带有标题的 Octave 中的大型柱状数据文件?

发布于 2024-12-29 09:21:26 字数 311 浏览 4 评论 0原文

我有一个 .dat 文件,该文件以空格/制表符分隔,并带有 1 行标题。该文件大约有60列数据。还有其他一些具有其他数量的列。

我如何读取标题(也许作为向量?),以便我可以索引到数据矩阵的适当列,而不必手动计算到正确的列?

我似乎记得 Matlab 能够创建以标题作为索引的元胞数组。 Octave 中是否有可能实现类似的功能?

到目前为止,我所能得到的只是根据以下内容的实际数据:

a = dlmread('Core.dat'," ",r0=1,c0=0);

非常感谢任何和所有帮助!谢谢!

I have a .dat file that is space/tab delimited with 1 line of headers. There are about 60 columns of data in this file. There are others with other numbers of columns.

How can I read in the headers (as a vector, perhaps?) such that I can index into the appropriate column of the data-matrix without having to count my way manually to the correct column?

I seem to recall Matlab being able to create cell-arrays with headers as indexes. Is anything like that remotely possible in Octave?

So far, all I can get is the actual data according to this:

a = dlmread('Core.dat'," ",r0=1,c0=0);

Any and all help is much appreciated! Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街角卖回忆 2025-01-05 09:21:26

我一直在寻找一种仅使用标准包来完成此操作的简单方法,但似乎没有。

然而,它看起来确实像 dataframe 包,可能会让你做这种事情。

不过,似乎确实应该在该语言中内置一些更简单的东西。

I've been looking for an easy way to do this using just the standard packages, also, but there doesn't seem to be one.

However, it does look like the dataframe package, might let you do this sort of thing.

It does seem like something simpler should be built into the language, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文