MATLAB: Simple vector question. vector If there is a vector C, C = [3 8 9 7 3] how can I make another vector that displays its position? eg. D = [1 2 3 4 5] eg2. E = [6 10 9 11 3 9 31 41] F = [1 2 3 4 5 6 7 8] eg3. Y = [7 5 3 1 8 6] Z = [1 2 3 4 5 6] Best Answer TryD = 1 : length(C);Similarly for the other letter-named vectors. Related SolutionsMATLAB: Simple vector question. One approach:in1 = [5 4 1 8 9 1]; in2 = [7 3 5 5];cin = {in1; in2}; % Create Cell Array For Addressing ConvenienceLin = [length(in1) length(in2)]; % Vector LengthsLdif = abs(Lin(1)-Lin(2)); % Length Difference[~,Lmin] = min(Lin); % Find Vector With Minimum Lengthcin{Lmin} = [cin{Lmin} cin{Lmin}(end)+[1:Ldif]]; % Extend Shorter Vector As Desiredvec = zeros(1, 2*max(Lin)); % Preallocatevec(1:2:end) = cin{1}; % Weave Odd Elementsvec(2:2:end) = cin{2}; % Weave Even Elementsvec = 5 7 4 3 1 5 8 5 9 6 1 7 MATLAB: Help running Matlab script Related QuestionMATLAB Operation question.Find the pair of the matrixVector indexing inefficiency question.Divide an array in n different arraysHow to modify a matrix to change the entries >=0 and multiply it by 5 AND to change the entries <0 and add 2 to those entries
Best Answer