Matlab m-file compilation - matlab

I need to compile a matlab m-file , file.m .
I also want to add some helper files and shared resources which are in folders
c:\tt\folder1\
c:\tt\folder2\
I can easily do this using the deploytool option in matlab. But I want to be able to do this using the matlab commandline. After some searches, I found the following code
mcc -m file.m -I C:\tt\folder1 -I C:\tt\folder2
but this is not doing anything. Matlab just goes into 'busy mode'.
Can anyone tell me what I am doing wrong??...

mcc -m file.m -a C:\tt\folder1 -a C:\tt\folder2

Related

Can you get full command line from process ID (including command line arguments, etc)?

This question is in addition to the question asked here: https://unix.stackexchange.com/questions/163145/how-to-get-whole-command-line-from-a-process. On my system, the following command results in a PID (as expected):
CUDA_VISIBLE_DEVICES=4,5 python3 main.py 1> out.txt 2> err.txt &
Now, the methods in the stack exchange link above provide many solutions. However, when trying these solutions, I only receive the following information:
python3 main.py
Is there a way to return the entire command line "CUDA_VISIBLE_DEVICES=4,5 python3 main.py 1> out.txt 2> err.txt &", not just the portion "python3 main.py"?
No.
Assuming you're on a Linux system, you can find the individual bits, but you can't put it together.
Assume also that the process's PID is in $pid
The CUDA_VISIBLE_DEVICES=4,5 variable gets added to the environment of the python command. You can find it in /proc/$pid/environ but you can't tell which of those variables were specified on the command line: the user could have written
export CUDA_VISIBLE_DEVICES=4,5
python3 main.py 1> out.txt 2> err.txt &
The file redirections are available in /proc/$pid/fd:
/proc/$pid/fd/1 is a symbolic link to out.txt
/proc/$pid/fd/2 is a symbolic link to err.txt
I don't know how to tell if a process is running in the background.
Since you're just interested in the environment: with bash
declare -A environ
while IFS='=' read -r -d '' var value; do
environ["$var"]="$value"
done < /proc/$pid/environ
echo "process has CUDA_VISIBLE_DEVICE value ${environ[CUDA_VISIBLE_DEVICE]}"

Convert Perl Script to Executable file packaging YAML file in executable used by perl script

I have small perl script test.pl. This perl script uses input as YAML file database.yml
To convert these perl script into executable, I run following command shown below.
pp -o -x teste.exe test.pl.
It creates executable but when i try to run this executable it throws error that database.yml file not found in that directory.
How can i ensure that executable includes YAML file while creating the exe of perl script?
Note :- I am using perl verison 5.8 in Unix.
By using the -a switch :
pp -a database.yml -o -x teste.exe test.pl
From pp documentation :
-a, --addfile=FILE|DIR
Add an extra file into the package. If the file is a directory, recursively add all files inside that directory, with links turned into actual files.
By default, files are placed under "/" inside the package with their original names. You may override this by appending the target filename after a ";", like this:
% pp -a "old_filename.txt;new_filename.txt"
% pp -a "old_dirname;new_dirname"
You may specify "-a" multiple times.

Using wget (for windows) to download all MIDI files

I've been trying to use wget to download all midi files from a website (http://cyberhymnal.org/) using:
wget64 -r -l1 H -t1 -nd -N -np -A.mid -erobots=off http://cyberhymnal.org/
I got the syntax from various sites which all suggest the same thing, but it doesn't download anything. I've tried various variations on the theme, such as different values for '-l' etc.
Does anybody have any suggestions as to what I am doing wrong? Is it the fact that I am using Windows?
Thanks in advance.
I don't know much about all the parameters you are using like H, -t1, -N etc though we can find it online. But I also had to download files from a url matching a wildcard. So command that worked for me:
wget -r -l1 -nH --cut-dirs=100 -np "$url" -P "${newLocalLib/$tokenFind}" -A "com.iontrading.arcreporting.*.jar"
after -P you specify the path where you wanna save the files to and after -A you provide the wild card token. Like in your case that would be "*.mid".
-A means Accept. So here we provide the files to accept from the provided URL. Similarly -R for reject list.
You may have better luck (at least, you'll get more MIDI files), if you try the actual Cyber Hymnal™, which moved over 10 years ago. The current URL is now http://www.hymntime.com/tch/.

Export weka results on command line

Is it possible to export weka results after execute it via command line?
What I am doing:
java -cp "./weka.jar" weka.classifiers.bayes.NaiveBayes -t "iris.arff" -i
But then, I have all the statistics in console, is there any way to export this? Or I have to read and write by myself?
Thanks!
An example from the Weka Primer:
java -Xmx1024m weka.classifiers.trees.J48 -t data.arff -i -k -d J48-data.model >&! J48-data.out &
So no, WEKA doesn't have a specific output parameter on the command line, but you simply redirect the output and errors to a file using >&! or only the output without errors using >.
In your case you could use this command to save the output to the file NaiveBayes-iris.out:
java -cp "./weka.jar" weka.classifiers.bayes.NaiveBayes -t "iris.arff" -i > NaiveBayes-iris.out

bsub and Matlab

I'm running matlab jobs on a remote server. The documentation says to run 'script.m', use the following command:
bsub -o script.out -R "rusage[matlab=1:duration=1]" matlab -nodisplay script
This doesn't seem to do much (or anything).
However,
bsub -o script.out -R "rusage[matlab=1:duration=1]" matlab -nodisplay -r "script"
works though. Any idea why the -r and quotation marks were omitted in the documentation? Was this simply a mistake, or am I misunderstanding something.
That looks just plain wrong to me, MATLAB has always needed the -r option to run a script.