MATLAB Answers


Is there a matlab function similar to numpy.spacing

Asked by Adam Stevens on 17 Sep 2019
Latest activity Commented on by Adam Stevens on 18 Sep 2019
Is there a matlab function similar to numpy.spacing ?


It would be far easier to answer, if you actually told people what that code does in python. Even give an example.
Well its a little hard to explain. I thought a google search would be easier.
It gives the difference between a number and the next clossest number depending on the precission being used.
Here is the documentation
It is used in scipy's DARE solution to check for stability.

Sign in to comment.

1 Answer

Answer by James Tursa
on 17 Sep 2019
 Accepted Answer

From the numpy.spacing doc:
"It can be considered as a generalization of EPS ... there should not be any representable number between x + spacing(x) and x for any finite x."
Sounds like the MATLAB function eps( ) is what you want.


Sign in to comment.