MATLAB: Scalar to vector formation, k = [k1 k2 k3 k4] to [k1,-k1,0,0:-k1,k1+k2,-k2,0:0,-k2,k2+k3,0:0,0,-k3,k3+k4] commands for the above matrix formation. Best Answer k = [0.6337,0.6337,0.6337,0.6337];n = numel(k);m = zeros(n);m(2:n+1:end-n) = 0-k(1:end-1); % lowerm(1+n:n+1:end) = 0-k(1:end-1); % upperm(1:n+1:end) = [0,k(1:end-1)]+k % mainGiving:m = 0.63370 -0.63370 0.00000 0.00000 -0.63370 1.26740 -0.63370 0.00000 0.00000 -0.63370 1.26740 -0.63370 0.00000 0.00000 -0.63370 1.26740 Related SolutionsMATLAB: 0.1+0.2-0.3= stupid, no; common, yes.FAQ6.1In fact this is the most frequently asked question on here and CSSM. MATLAB: How to plot fsolve resulting array of answers…. plot(valxy) Related QuestionCreate a matrix from a vectorHow to make a slide windowsFast creation of vector [0 0 1 1 2 2 3 3… n n]Storing vectors from a for loop, into a 2d matrix.How to convert A=[1 3 2] to B= [ 1 0 0;0 0 3;0 2 0]
Best Answer