MATLAB: Write a function halfway(n) that given an odd integer n as input, returns the integer that’s halfway between 1 and n. >> halfway(9) ans = 5 MATLAB plz help Best Answer N = 9 ;x = round(mean(1:N)) Related SolutionsMATLAB: How to create an n by n wilkinson matrix using diag n = 10;W = spdiags([n:-1:1; n*ones(1,n)]',[0 1],n,n); MATLAB: Highest power of 2 that divides n. In addition to David's comments, you need to do all of the calculations symbolically, so all of these should be sym: 2, i, r. Related QuestionColumn of matrices for arbitrary N.
Best Answer