function the_norm = nma_find_norm(grid) %find the grid norm %---------------------------------------------------------------- % This function is called from number of places to find the norm % INPUT: % grid: 2D matrix % OUTPUT: % grid norm. norm 2 is used % % by Nasser M. Abbasi % Math 228a, UC Davis, Fall 2010 % nma_validate_dimensions_1(grid); [n,~]=size(grid); h = 1/(n-1); the_norm = sqrt(h)*norm(reshape(grid,1,n^2),2); %the_norm = sqrt(h)*norm(reshape(grid(2:end-1,2:end-1),1,(n-2)^2),2); %the_norm = h*norm(grid); end