function c=str2num(x)
    a=ascii(x);
    d=0;
    d1=0;
    ml=1;
    for i=1:length(a)
        if (a(i)==45) then
            ml=-1
            continue;
        end
        if (a(i)==43) then
         
            continue;
        end
        if (a(i)==46) then
            break;
        end
        temp=a(i)-48;
        d=d*10+temp;
    end
    for j=length(a):-1:(i+1)
        temp=a(j)-48;
        d1=d1/10+temp/10; 
    end
    
    
    
    c=ml*(d+d1);
endfunction
