MATLAB: How do you find solutions of this marix equation using matlab 2019 solve matrix equations how to find solutions of this matrix using matlab 2019. Ax = b A = [3.8 -7.8;8.4 -16.8;-12.9 -41.4]b = [1.3;2.8;-4.3] Best Answer Let's first do some algebra, and then solve it with a oneliner:%{Ax = bA\Ax = A\b (A\A = 1)x = A\b%}A = [3.8 -7.8;8.4 -16.8;-12.9 -41.4];b = [1.3;2.8;-4.3];x=A\b Related SolutionsMATLAB: Marix manipulation My solution has a for loop.[b, i, j] = unique(a(:, 1:(end-1)), 'rows');c = b;for ii = 1:length(i) c(ii, 4) = sum(a(j==ii, 4));endMy guess is that it can be eliminated (and potentially made faster) with a bsxfun or arrayfun. In order to optimize it, we would need to know the sizes and how often things repeat. MATLAB: Storing elments of marix from text file into variables This is a bad method to store data, because Matlab must guess the size of the data.fid = fopen(FileName, 'r');if fid==-1, error(Cannot open file: %s', FileName); endFirstLine = fgets(fid);y = sscanf(FirstLine, '%f');n = length(y);M = fscanf(fid, '%f', [n+1, Inf]);fclose(fid);x = M(:, 1);Data = M(:, 2:n+1);Perhaps you need some transpose operators to get the wanted orientations. Related QuestionCompute the difference matix between a marix and another matrix in MATLABFind previous time conditions were met, save it as new marix
Best Answer