MATLAB: How can i make matrix 1 1/2 1/3 1/4 … 1/n matrix a = 1 1/2 1/3 …. 1/n 1/2 1/3 1/4 … 1/3 1/4 1/5 ….. .. .. 1/n 1/n+1 1/n+2 … how can i make this matrix?? Best Answer This is built in to Matlab. Try help hilb in the workspace. Related SolutionsMATLAB: Matrix ifft tranform m = [1 1 -1 1 % data matrix 1 1 1 1 -1 -1 -1 1 1 -1 -1 -1 1 -1 -1 -1 -1 -1 1 1 1 1 1 -1 1 1 1 1 -1 1 1 -1 -1 -1 1 1 -1 1 -1 1 1 1 1 1];M = ifft(m, [], 2) % transform each row MATLAB: Matrix[1,1,1,1;-1,-1,-1,-1;1,1,1,1] to vector[1,1,1,1,-1,-1,-1,-1,1,1,1,1] I believe you intended semicolons (;) instead of colons (:) in your matrix definition.To convert it to a vector, use the reshape function:Matrix = [1,1,1,1; -1,-1,-1,-1; 1,1,1,1];Vector = reshape(Matrix', 1, [])Vector = 1 1 1 1 -1 -1 -1 -1 1 1 1 1EDIT — Added output of ‘Vector’. Related Question-1 and 1 matrixSimpson’s 1/3 rulesError using griddedInterpolant The grid vectors do not define a grid of points that match the given values.
Best Answer