MATLAB: Issue in matrix multiplication matlab function G=[1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 1 0 0 1 0 0 1 0; 1 0 0 1 1 1 0 1 0 0 0 1]; m=[1 0 1 0] how to multiply them?? Best Answer G is 4x12 and m is 1x4, then two possibilities : m*G G'*m'You do not get binary result because of the multiplication cij=sum a_ik b_kj there is an addition. you can get binary results if the matrices have the same dimensions and you use Hadamard product :m=m'M=zeros(4,12);for n=1:12M(:,n)=m;endM.*G Related SolutionsMATLAB: Matrix multiplication issue.. i need the result to be in binary numbers Dear Mary, you can do it as follow:m = rand(1,4) > 0.5;G = [1 1 1 1 1 0 0 0 1 0 0 0; 0 0 1 1 0 0 0 1 0 1 0 0; 1 1 1 0 1 0 0 1 0 0 1 0; 1 0 0 1 1 1 0 1 0 0 0 1];c = double(logical(m * G));It is what you need? MATLAB: Change binary string to decimal try use this is code:GGG =[ 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1]out = GGG*2.^(size(GGG,2)-1:-1:0).'; Related QuestionRemove elements from a matrixSignal in and signal out need to be shifted to match one another…Creating a large matrix with a patternFor loopHow to simplify the numerical portion of the symbolic expression using Symbolic Math Toolbox 3.2 (R2007a)
Best Answer