オクターブ セッションを格納およびロードする小さなヘルパー関数を書きたいと考えています。
function restoreSession(filename)
history -r strcat('./states/',filename,'.history');
load("-binary", strcat('./states/',filename,'.data'))
endfunction
function saveSession(filename)
history -w strcat('./states/',filename,'.history');
save("-binary", strcat('./states/',filename,'.data'))
endfunction
保存/読み込みコマンドはうまく機能します。私の問題は、履歴コマンドが引数を評価していないように見えることです。次のエラーが発生します。
syntax error
>>> history -r strcat('./states/',filename,'.history');
^
私はすでにパスに一時変数を使用しようとしましたが、この場合、変数名をファイル名として解釈するだけで、ファイルが見つからないと文句を言います。
これを解決する方法を知っている人はいますか?