exec("plo-6ren">
gpt4 book ai didi

exec 命令的 Scilab 问题

转载 作者:行者123 更新时间:2023-12-03 17:54:18 27 4
gpt4 key购买 nike

我在 OSX 10.7.4 上使用 Scinote 5.4.0。我无法使用 exec("path") 从控制台执行脚本文件命令;当我这样做时,只读取脚本文件的第一行。

例子:

-->exec("plot1.sce") 
-->x=[0:.1:10]'; //(the first line of my code)

但是,如果我从编辑器 Scinote 中“使用 echo 执行”,脚本将运行得很好。

有人知道发生了什么吗? (我试图运行的脚本文件在我当前的工作目录中)。

谢谢!

更新:我刚刚在同一台机器上安装了 Scilab,并且发生了同样的事情。

更新:根据 Scilab 的 bugtracker,它似乎是由 Scinote 在 Mac 上默认为 cr eol 引起的。我真的不知道这意味着什么或如何解决它,但冒险仍在继续!

更新:我找到了解决方案!: http://comments.gmane.org/gmane.comp.mathematics.scilab.user/6184

在首选项里,我把eol改成Unix,默认文件编码改成iso-8859-1。我重新启动,exec 现在可以工作了!

最佳答案

该链接不容易遵循,所以这是答案(粘贴)

The problem is actually scinote's, not scilab's. I don't have a Lion machine to check if I'm correct, but it seems scinote's file encoding is no longer compatible in ML. I discovered that when I opened scinote generated files with a different text editor (vi) the new lines weren't encoded right for my machine. The other give-away was that executing scripts written prior to upgrading worked fine.

Go to preferences and in the scinotes tab, switch default file encoding to iso-8859-1. I also switched the end-of-line to Unix.

关于exec 命令的 Scilab 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13772610/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com