I need help please, How do I return a matrix from a function in matlab? I have a matrix with zeros(size NxN). I send the matrix to some function to update her. How do I return the updated matrix?
in a code:
matrix = zeros(size); %put zeros
updateMatrix(radius,x0,y0,matrix);%call to function
function updateMatrix(radius,x0,y0,matrix)
update the matrix
end
continue the prog with the updated matrix
I just need to return the updated matrix, and I don't change the other variables.
I tried to do this:
matrix = zeros(size); %put zeros
matrix=updateMatrix(radius,x0,y0,matrix);%call to function
function [matrix]=updateMatrix(radius,x0,y0,matrix)
update the matrix
end
continue the prog with the updated matrix
But it doesn't work.
Thanks!