在 Octave 中使用字符串调用命令

Use a string to call commands in Octave

假设我定义

Octave:1>s = "hello";
Octave:2>mkdir s
Octave:3>cd s

这将创建一个名为 s 的目录(而不是 hello),然后切换到该目录。如何使用 hello 代替?

mkdir(s)
cd(s)

看看功能语法和命令语法:https://octave.org/doc/v5.2.0/Commands.html