MATLAB: How to assign a string with a value in repmat repmatstring I have a value, A = -1. I want to use repmat as so: B = repmat('A',1,2); but this gives me [A,A] and not [-1,-1] as I want it to. Seems very simple but I cannot get it. Help please. Thank you. Best Answer B = repmat(A,1,2) Related SolutionsMATLAB: Help regarding finding the values below intersect value from two different dimension matrix a(1:find(ismember(a,b))-1,1) MATLAB: Matrix manipulation, maybe repmat Dynamic version of the solution proposed by proecsm:n = 2;idx = repmat(1:size(a,1),n,1);b = a(idx(:),:)orkron(A,ones(n,1))orhttp://www.mathworks.com/matlabcentral/fileexchange/24536-expand Related QuestionI want to initialize a matrix of 3×3 to value -1 how this colud be doneRepmatHow to limit the repmatCan you do this calculation with bsxfun instead of repmatElemental matrix multiplication [NxN] and [1xn] into [NxNxn]
Best Answer