displaying element of matrix

How can I display a matrix as output of a function which element are two decimal point based number.

 Accepted Answer

Scott MacKenzie
Scott MacKenzie on 2 May 2021
Edited: Scott MacKenzie on 2 May 2021
% assume M is a matrix of numeric values returned by your function
fprintf('%.2f\n', M); % print all the values, 2 decimal places each

2 Comments

thank you sir.
@Eram Khan, if it did what you want, please "Accept this answer" to award Scott his "reputation points".

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!