create a m.file function in Matlab that ask which
element of the magic matrix to replace then replaces it.
function x = replace(x) %function that takes magic matrix as argument and return modified matrix
a=input("which element of the magic matrix to replace: ");
b=input("with what to replace the element: ");
x(x==a)=b; %replacing elements of given magic matrix
end
function x = replace(x) %function that takes magic matrix as argument and return modified matrix
a=input("which element of the magic matrix to replace: ");
b=input("with what to replace the element: ");
x(x==a)=b; %replacing elements of given magic matrix
end
Get Answers For Free
Most questions answered within 1 hours.