Search code examples
matlabdoubledigits

how I must use digits function in matlab


i have code and use double function several time to convert sym to double.to increase precision , I want to use digits function. I want to know it is enough that I write digits in the top of code or I must write digits in above of every double function.


Solution

  • digits set's the precision until it is changed again. Calling digits() without any input you get the precision to verify it's set correct.

    In many cases digis has absoluetly no influence on symbolic variables because an analytical solution is found. This means there are no precision errors unless you convert to double. When convertig, digits should be set to at least 16 because this matches double precision.