From: Ha on
The program occupies increasing memory storage and the computer becomes slower and slower... finally, the error of "out of memory" happens. However, during the running of the program, no new variable is created. Why does the program needs an increasing memory?

Possibly, I think, this may be caused during calling 'myfcn' in a nested loop. So, I test it with some simple codes: for n=1:10000, p=myfcn(C,ph); end. That veritified my judgement. BTW, function 'myfcn' is the only function involving symblic operation.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [pzs] = myfcn(C, ph)
syms pz
ph = real(ph);
P = [ph,pz; -pz,ph];
CM = P * C * P.';
eq = det(CM-eye(2));
cc = sym2poly(eq);
pzs = roots(cc);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Another problem I'm confusing is that even after I clear all the variables by executing "clear", the memory are not released.
From: us on
"Ha "
> Another problem I'm confusing is that even after I clear all the variables by executing "clear", the memory are not released.

it is...
- download this great utility (in case you run a wintel sys)...

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

% start ML, then
% open PROCESS EXPLORER, select ML, select the -performance graph- tab
% then
m=rand(10000);
% watch -private bytes- in the graph...
clear m;
% watch, again...

us