从Octave保存.fig文件 [英] Saving .fig file from Octave

查看:714
本文介绍了从Octave保存.fig文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要制作一个.fig文件,该文件可以在Matlab中重新打开,但是我在Octave中工作.但显然在Octave中没有 saveas 命令.这就是我正在尝试的:

I need to make a .fig file that can be reopened in Matlab, but I am working in Octave. But apparently there is no saveas command in Octave. This is what I am trying:

octave:3> plot([1,2,3],[45,23,10])
octave:4> saveas(gcf,'myfig.fig')
error: `saveas' undefined near line 4 column 1
octave:4> 

推荐答案

当前,Matlab无花果文件格式是专有的二进制文件格式.

Currently the Matlab fig file format is a proprietary binary file format.

Octave不知道如何导出为这种格式,并且只有经过反向工程后才能使用. Octave知道的无花果格式是Xfig使用的另一种无花果格式,具有相同的扩展名,但没有其他共同之处.

Octave doesn't know how to export to this format and won't be able to until it is reverse engineered. The fig format that Octave knows about is a different fig format used by Xfig with the same extension name, but nothing else in common.

要将打印图导出为八度的其他格式,请使用打印命令E.g print -deps myplot.epsprint -dpng myplot.png.

To export the plot to other formats in octave use the print command E.g print -deps myplot.eps or print -dpng myplot.png .

当然,尽管您可以打开使用imread生成的图像,但是这不允许您在Matlab中打开要编辑的图.

Of course this doesn't let you open the plot for editing in Matlab , though you can open the image generated using imread.

有一个项目可以在Octave中读取Matlab无花果文件,该项目位于

There was a project to read Matlab fig files in Octave located here but the relevant .m file doesn't seem to be archived successfully.

如果找到了该m文件的副本,并且它成功地在Octave中读取了Matlab无花果文件,则可以使用它来制作一个从Octave写入无花果文件的Octave脚本.

If you found a copy of that m file and it successfully read Matlab fig files in Octave you could use it to make an Octave script that wrote fig files from Octave.

或者,您可以使用save命令将矩阵/原始数据加载保存为Matlab .mat文件或其他文件格式,然后将其加载到Matlab中并用Matlab重新绘制.

Alternatvely you can use the save command to save the matrix / raw data load into a Matlab .mat file or other file format, then load that in Matlab and replot it with Matlab.

这篇关于从Octave保存.fig文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆