Given A = [1 2 3;4 5 6;5 4 3], write code to set any value less than 3 to 0 and any value greater than 3 to 1. On Matlab
Given A = [1 2 3;4 5 6;5 4 3] code to set any value less than 3 to 0 and any value greater than 3 to 1 [rows, columns] = size(A); for i=1:rows for j=1:columns if(A(i,j)<3) A(i,j) = 0; elseif(A(i,j)>3) A(i,j) = 1; end end end
A = [1 2 3;4 5 6;5 4 3]; [rows, columns] = size(A); for i=1:rows for j=1:columns if(A(i,j)<3) A(i,j) = 0; elseif(A(i,j)>3) A(i,j) = 1; end end end A
Get Answers For Free
Most questions answered within 1 hours.