Search code examples
matlabevalsymbolic-math

evaluating symbolic string calling server matlab


I'm trying to use some matlab code put out to help in circuit evaluation. The code is SCAM from Eric cheever of Swarthmore. The code runs fine until it reaches the eval function:

eval(SymbolicString);

For some reason eval is calling up the server from the original code. Should it be doing this? Do I need to create an evaluation function of my own to run this code? I can't see where it is calling the server from. This is the error function being thrown:

    Error in syms (line 56)
    assignin('caller',varargin{i},sym(varargin{i}));

    Error in scam (line 263)
    eval(SymbolicString);


    Error using sym (line 198)
    Error using maplemex
    License server machine is down or not responding.

I would think that the server was actually down, except that I actually can't see where it is being called and their website server was updated and put back up yesterday.


Solution

  • It might be checking for a license for the symbolic toolbox. MathWorks really likes it when you pay them money. If you, for whatever reason, don't have enough money to pay them then you might consider a tool like "R" or "Sage". Mathworks is not the only tool that has symbolic algebra AND numeric methods.

    if you have

    a=1
    b=2
    x=sym('a+b^2')
    eval(x)
    

    then you might also consider:

    1. using other commands like subs or subs(char(...),...)
    2. you might convert it to char, use fprintf to write it into a function, then call that function
    3. try to evaluate it using fplot or fplot(char(...),...) with only a single output value