在gnuplot for Windows中,如何列出当前/工作目录中的文件?

时间:2012-07-19 20:25:03

标签: gnuplot

我正在为Windows运行gnuplot版本4.6(补丁级别0)。该程序的Windows版本提供了一个控制台或命令提示符界面,类似于Unix / Linux中的bash shell或Windows中的DOS 命令提示符

Windows gnuplot中的某些命令与Unix / Linux或DOS中的命令类似。例如,pwd打印当前/工作目录。此外,cd更改了目录,因此我可以使用cd 'C:\Documents and Settings'等命令。

然而,我奇怪地无法弄清楚如何列出当前/工作目录中的文件(在Unix / Linux中将是ls,在DOS中将是dir)。你知道怎么做吗?

3 个答案:

答案 0 :(得分:5)

Gnuplot 4.6.0的快速代码检查显示Windows中不支持ls(或类似)。

但是,您可以使用system命令,例如system 'dir'

答案 1 :(得分:2)

如果您只想在Windows gnuplot控制台中查看工作目录的列表,以下内容适用于我,但使用反引号:

`dir && pause`

或者

system("dir && pause")

这将打开单独的cmd窗口并保持打开状态,直到你按下一个键。

答案 2 :(得分:0)

由于您可能只需要脚本文件名,因此可以使用

Mat originalMat = someMat;
Mat blackMat = Mat.zeros(size, CvType.CV_8UC1); // it is your black mat
// create a submat from the original mat, and clone it
Mat roiMat = originalMat.submat(rect).clone();

..... // do what you want with roiMat

// now copy the result to the original mat
Mat dst = originalMat.submat(rect); // do not clone this submat
roiMat.copyTo(dst);
// done!

/ B 摆脱了标题,摘要和其他信息。