MATLAB Answers

ERROR : Missing domain attribute 'min'

4 views (last 30 days)
Emiliano Rosso
Emiliano Rosso on 28 Nov 2018
Answered: Steven Lord on 25 Oct 2019
when I use :
symmin=@(x,y)feval(symengine,'min',x,y);
symmin(3,4)
ans=
3
but if I want to find the minimum of a vector :
symmin=@(x)feval(symengine,'min',x); % or
symmin=@(x)feval(symengine,'min',x(1:10));
a=1:10;
symmin(a)
error using mupadengine/feval (line 187)
Missing domain attribute 'min'.
Can you explain me why ?

  1 Comment

David André Gomez Romero
David André Gomez Romero on 25 Oct 2019
Did you find a solution ? I have the same problem...

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 25 Oct 2019
symmin = @(x) feval(symengine, 'min',feval(symengine,'op',x))

  0 Comments

Sign in to comment.


Steven Lord
Steven Lord on 25 Oct 2019
Why are you trying to use feval on the symengine object to take the minimum of your symbolic input? Why not just call min directly on the symbolic object(s)?
two = sym(2);
three = sym(3);
z = min(two, three)
y = [two three two two three];
z2 = min(y)

  0 Comments

Sign in to comment.