Vectorize the following code. Write one assignment statement that would accomplish the same thing. Assume that mat is a matrix variable that has been initialized
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:5| Question number:29.5
All Answers
total answers (1)
[r,c] = size(mat);
val = mat(1,1);
for i = 1:r
for j = 1:c
if mat(i,j) < val
val = mat(i,j);
end
end
end
val % just for display
val = min(min(mat))
need an explanation for this answer? contact us directly to get an explanation for this answer