displaying element of matrix
2 views (last 30 days)
Show older comments
Eram Khan
on 2 May 2021
Commented: Image Analyst
on 2 May 2021
How can I display a matrix as output of a function which element are two decimal point based number.
0 Comments
Accepted Answer
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
Image Analyst
on 2 May 2021
@Eram Khan, if it did what you want, please "Accept this answer" to award Scott his "reputation points".
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!