MATLAB: Matlab results grouped question math results How can i have in results all the first results and all the second results regrouped? 0.3151 -0.3904 0.3412 -0.3416 0.3581 -0.2836 Best Answer Hi,i assume you have the results in a form of:res1 = [0.3151; -0.3904]res2 = [0.3412; -0.3416]res3 = [0.3581; -0.2836]which looks like in your question:res1 = 0.315100000000000 -0.390400000000000res2 = 0.341200000000000 -0.341600000000000res3 = 0.358100000000000 -0.283600000000000Then you can do:res = reshape([res1; res2; res3],2,[]);group1 = res(1,:)'group2 = res(2,:)'which results in:group1 = 0.315100000000000 0.341200000000000 0.358100000000000group2 = -0.390400000000000 -0.341600000000000 -0.283600000000000Check the reshape function - it is very useful.Best regardsStephan Related SolutionsMATLAB: Error calculating matrix operations for i=1:14ACCANG(:,i) = (-(Jinv))*([AB*(w2(i))*cosd(beta(i)), BO*(w3(i))*cosd(gamma(i)); -AB*(w2(i))*sind(beta(i)), -BO*(w3(i))*sind(gamma(i))]*[w2(i); w3(i)]+[OA*sind(alfa(i)); OA*cosd(alfa(i))]+[OA*cosd(alfa(i)); -OA*sind(alfa(i))])end MATLAB: Interp1 gpuArray bug The bug appears to have been fixed in R2019b:>> A=rand(80,2);>> interp1((1:80)', A, gpuArray(((1:2))'))ans = 0.6073 0.3774 0.4501 0.2160>> interp1(A, gpuArray(((1:2))'))ans = 0.6073 0.3774 0.4501 0.2160 Related QuestionMatlab’s quad equals 0 when over 0 to 6 and actual value over 3 to 5Which algorithm does MATLAB eig() use to diagonalize a complex symmetric matrix
Best Answer