顯示具有 MATLAB 標籤的文章。 顯示所有文章
顯示具有 MATLAB 標籤的文章。 顯示所有文章

2010/04/05

How to run script in batch mode or background

 

comsol matlab -ml -nodesktop -ml -nosplash -mlr "myscript, exit"

Note: add a line at the beginning of the script

flreport('off')

in background

nohup comsol matlab –ml –nodesktop –ml –nosplash < myscript.m >& nohup.log &

2009/07/28

How to run m-function on linux in the background

 

nohup matlab < test.m > output.log &

If you don’t need the output, change “output.log” instead of /dev/null.

2009/07/27

How to use more than 2G memory in MATLAB

 

Memory Support and Windows Operating Systems

boot.ini

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINNT
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINNT="????" /3GB

2009/02/11

0.1+0.1+0.1-0.3 != 0 ?!!!!!

 

If you type the this question in command line of MATLAB, you'll probably get the answer other than zero.

 

5.5511e-017

The guyes work for MATLAB wrote on their blog and explained why.

Ken & Mike on the MATLAB Desktop

 

And the lady even insists that " it's not an error".  How ridiculous!

Loren on the Art of MATLAB

Hugh-

This is not an error. If MATLAB were built to get that answer to be 0, we’d have to do a bunch of operations to sort the data in the “right” order. How would MATLAB actually know that IS the way the values should be accumulated from the real-world? You can have MATLAB perform calculations in whatever order you wish by using parentheses. Or introduce a function that sorts the data appropriately and then does the sums and differences.

As long as there is no way to perfectly represent some values, floating point calculations are subject to round-off error. As for the other languages, it depends on how the code is written so they get exactly 0. If the constants are built into the program rather than user-supplied at run-time, it’s possible that a C++ compiler will reorder the operations on constants. And Mathematica might be doing the calculations using extended precision (but I don’t know that for certain).

–Loren

Anyway, it seems that no solution will be provided for this "problem", so I'd better keep that in mind if I need to use  if (0.3==0.1*3)  this kind of statement in my program.

What a great team of MATLAB!

2008/11/29

How to use MATLAB and COMSOL on the cluster

You can launch COMSOL or MATLAB on the cluster from everywhere as long as you can access internet.
Open cygwin and keyin:


ssh -X11 yourCCID@masternode.eche.ualberta.ca
qsub -l nodes=1,walltime=20:00:00 -I

image

Remember the number of the node, in this case node14.

Open the other cygwin and start XWin by using "startx"

ssh -Y CCID@masternode.eche.ualberta.ca
ssh nodeN

 

image

image image