How can I control matlab from ubuntu terminal?
4 ビュー (過去 30 日間)
古いコメントを表示
Paschalis Garouniatis
2017 年 7 月 30 日
コメント済み: Walter Roberson
2017 年 7 月 31 日
Hi everyone. I want to create a shell script which will identify a text file given from the user and then open matlab and extract data from within the text file. This is what I've done so far:
#!/bin/bash
read -p "Type desired file for data mining :" filename
echo "Selected file : $filename.txt"
cd Desktop/ocean_lab_data
vi $filename.txt
cd ../
cd ../
cd ../
cd ../
cd usr/local/MATLAB/R2016b/bin/
./matlab -nosplash -nodesktop
addpath(genpath('directory of the text file'));
A=importdata('$filename.txt');
My problem for now is that I can't pass the commands following "./matlab -no splash -nodesktop" into matlab. Any help will be much appreciated.
0 件のコメント
採用された回答
Walter Roberson
2017 年 7 月 30 日
Use the -r flag
./matlab -nosplash -nodesktop -r "addpath(genpath('directory of the text file')); A=importdata('$filename.txt');"
7 件のコメント
Walter Roberson
2017 年 7 月 31 日
At the moment I cannot think of any reason why additional arguments would be ignored if alias was used.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!