MATLAB: How to multiply two different length vectors using for loops in Matlab using for loop ie. [1 2 3] and [1 2] The results should be a vector [3 6 9]. That is (1×1)+(1×2)=3, (1×2)+(2×2)=6,(1×3)+(2×3)=9. Appreciate the help Best Answer A = [1 2 3] B = [1 2] C = sum(B.' * A, 1) Related SolutionsMATLAB: Delete matrix in cell cell_A={[1 1 1] [1 2 3;3 2 1] [4 5 6;7 8 9;1 1 1] [2 2 2;3 3 3] [9 9 9]};cell_B={[1 1 1] [1 2 3;3 2 1] [9 9 9]};m = length(cell_A) ; n = length(cell_B) ; iwant = cell_A ; for i = 1:m for j = 1:n if isequal(cell_A{i},cell_B{j}) iwant{i} = [] ; end endend% Remove empty cellsidx = cellfun(@isempty,iwant) ;iwant(idx) = [] ;celldisp(iwant) MATLAB: Deleting zeros from cell matrix without resizing or reshaping matrix a={ 1 2 6 2 6 6 1 0 0;1 7 2 5 0 6 4 7 1;3 2 0 2 6 7 4 7 3 }a(cellfun(@not,a))={[]} Related QuestionCompare two different length vectorsHow to multiply each element of a cell array by a different scalarGrouped boxplot with different lengthsHow to convert a cell array of cell arrays to matrix
Best Answer