How to suppress the ans in a user defined function
Show older comments
I have a function that identifies the max value of every column, then every row and the max value of the entire matrix itself.
However, whenever I run the code with a given matrix, it produces ans with the values assigned to every column, how do I suppress this?
This is my code.
function[mc,mr,mm] = MyMax_1(A)
mc = max(A);disp('maxcolumns'),disp(mc)
mr = max(A.');disp('maxrows'),disp(mr.')
mm = max(max(A));disp('maxmatrix'),disp(mm)
end
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!