2
There is a function similar to matlabFunction()
MATLAB? Or how to do this in R
?
The function in MATLAB.
syms x
dados = inputdlg({'P(x): ', 'Q(x): ', 'R(x): ', 'N: '},'Dados');
P = matlabFunction(sym(dados{1}),'vars',x,'file','px');
In R
I’m trying to do it this way:
P <- function(x){
expr = dados[1]
y <- eval(parse(text= expr), list(x))
return (y)
}
But I still have to change the expression within the function or pass it by parameter.
What this function does in Matlab?
– Rcoster
Converts symbolic expression to a function.
– Douglas Lohmann