如何将命令的Matlab输出重定向到文件?

编程入门 行业动态 更新时间:2024-10-19 01:23:29
本文介绍了如何将命令的Matlab输出重定向到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想将Matlab命令的输出重定向或复制到文件中.我该怎么办?

I want to redirect or copy the output of a Matlab command to a file. How can I do that?

就我而言,我想使用UNIX工具diff比较两个大型结构.

In my case, I have two large structs that I want to compare using the UNIX tool diff.

示例:我可以在Matlab中完成此操作

Example: I can do this in Matlab:

>> s1 s1 = a: 32 abc: 'example' >>

并想要一个包含大约:

s1 = a: 32 abc: 'example'

这些解决方案不可行:

  • 复制动作:无法(舒适地)自动化.
  • save -ascii:不适用于结构.
  • Copy-pase: can't automate (comfortably).
  • save -ascii: does not work with structs.
推荐答案

看看日记功能.例如

diary my_file.txt s1 diary off

文件my_file.txt将完全包含您在屏幕上看到的内容.

The file my_file.txt will then contain exactly what you see on screen.

更多推荐

如何将命令的Matlab输出重定向到文件?

本文发布于:2023-07-06 07:36:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1047382.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何将   重定向   命令   文件   Matlab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!