在朱莉娅(Julia)穿越嵌套的柱子

发布于 2025-01-28 19:15:26 字数 428 浏览 2 评论 0原文

我正在使用优秀的 Julia Mat File Reader 读取具有类似结构的垫子文件test2

Dict1 = Dict("a" => [1,3], "b" => 2, "c" => "Hello")
test2=Dict("test"=>Dict1,"a"=>[2,4])

带有读取命令,我可以这样访问dict1:

using MAT
read(file, "test")

但是我也想访问dict1中的变量,例如“ a”或“ b”。

有什么建议吗?

谢谢!

I'm using the excellent Julia Mat File reader to read a mat file with the structure similar to test2

Dict1 = Dict("a" => [1,3], "b" => 2, "c" => "Hello")
test2=Dict("test"=>Dict1,"a"=>[2,4])

With the read command I can access Dict1 like this:

using MAT
read(file, "test")

But I'd also like to access variables within Dict1, like "a" or "b".

Any suggestions?

Thanks!

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

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

发布评论

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

评论(1

独自唱情﹋歌 2025-02-04 19:15:26
dict_1 = Dict("a" => [1,3], "b" => 2, "c" => "Hello")

dict_2 = Dict("test" => dict_1, "a" => [2,4])

@show dict_2["test"]["b"]
dict_1 = Dict("a" => [1,3], "b" => 2, "c" => "Hello")

dict_2 = Dict("test" => dict_1, "a" => [2,4])

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