Home > OS >  matlab - symbolic functions freezing on command window
matlab - symbolic functions freezing on command window

Time:02-18

The following code freezes R2020b and R2018b in the command window with a clean workspace.

>> syms f(r, m)
>> f(r, m) = r^(m) * (1-r)^(70000000-m)
 
f(r, m) =
 
r^m*(1 - r)^(70000000 - m)
 
>> f(.001, 5000)

Am I using the wrong Matlab tool for this?

CodePudding user response:

clear
f = @(r, m) r^m * (1-r)^(70000000-m);
f(.001, 5000)

It can give the answer immediately.

Besides, I hardly use syms because it often freeze my computer.

  • Related