Changing 'precision' through startup ?

2 views (last 30 days)
Simple question, yet i havent found an answer: Is it possible to set the precission used for output (eg. using dlmwrite) in the startup.m file so i dont have to define it every time i use dlmwrite ?

Accepted Answer

Michael Haderlein
Michael Haderlein on 5 Aug 2014
Edited: Michael Haderlein on 5 Aug 2014
When you open the dlmwrite function, you will find that the standard value for precn is always 5 (variable precn in subfunction parseinput). Either just set the precision every time or create a "hull function" which passes all inputs further on to dlmwrite and adds the precision as additional parameter:
function dlmwrite2(varargin)
dlmwrite(varargin{:}, 'precision',2);
Michael Haderlein
Michael Haderlein on 5 Aug 2014
Dear John,
thanks for your comment, I wasn't aware of the possibility to use the type function. Of course I agree with you to not edit supplied functions.
Best regards,

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by