Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize syntax with fprintf #15

Open
aernesto opened this issue Sep 17, 2019 · 0 comments
Open

optimize syntax with fprintf #15

aernesto opened this issue Sep 17, 2019 · 0 comments

Comments

@aernesto
Copy link
Contributor

This line (and any other similar one) could be improved as per MATLAB's suggestion:

Explanation
The syntax disp(sprintf('...')) calls two functions and requires memory allocation. 
However, the syntax fprintf('...\n') requires no memory and allows the code to execute 
faster.
 
Suggested Action 
Replace disp(sprintf('...')) with fprintf('...\n'). You must include the new line 
character ('\n') to maintain behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant