MATLAB: Error + matrix dimension must agree matrix I got error — Error using + Matrix dimensions must agree. on this code. Please help me a=sign(X(ind1)).*(abs(X(ind1))-T); b=abs(X); c=plus(a,b); Best Answer Nik, X and T need to be same-sized vectors unless T is a scalar.What are you trying to do in a = sign(X(ind1)).*(abs(X(ind1))-T);especially w.r.t. T? Related SolutionsMATLAB: Error using / Matrix dimensions must agree fp = (1./(x + h) - 2*(1/x) + 1./(x - h)) ./h.^2; MATLAB: ???index exceeds matrix dimensions x=1:42c = 2*x+1more :)c = zeros(1,42);for x = 1:42 a = x; b = a + 1; c(x) = a + b;endmore 2x=1:42c = zeros(size(x));for i1 = 1:numel(x) if x(i1) == i1 a = x(i1); b = a + 1; end c(i1) = a + b;end Related QuestionAdd 3 to the values of x that are evenFinding the closest value in an array of 7 dimension vectorWhat does the expression x(ind -1) mean
Best Answer