function answer = MyInline(expr,var,value,var_order,pos)

if(~isempty(var_order))
    
    L_pos = length(pos(1,:));
    L_expr = length(expr);
   
    for i = L_pos:-1:1
        p = find(strcmp(var_order{i},var));
        pos(:,i) = pos(:,i);
        if(pos(1,i)==1 & pos(2,i)<L_expr)
            expr = [value{p},expr(pos(2,i)+1:end)];
        elseif(pos(1,i)>1 & pos(2,i)<L_expr)
            expr = [expr(1:pos(1,i)-1),value{p},expr(pos(2,i)+1:end)];
        elseif(pos(1,i)>1 & pos(2,i)==L_expr)
            expr = [expr(1:pos(1,i)-1),value{p}];
        else
            expr = value{p};
        end
       
    end
    
 end
 
answer = eval(expr);