MATLAB: Separate data from file datasource ip I attached data file. data is in format of source _ip:source_port->destination_ip:destination_port I want to take out only source_ip data from that, how to do. Best Answer load('n0 1.mat') ;s = VarName6 ;idx = strfind(s, ':');idx = cell2mat(idx) ;idx = idx(:,1)-1 ;iwant = cellfun(@(x,idx) x(1:idx),s,num2cell(idx), 'UniformOutput', false) ;Orload('n0 1.mat') ;s = VarName6 ;s1 = regexp(s,':','split') ;iwant = cellfun(@(x) x{1}(:)',s1, 'UniformOutput', false) ; Related SolutionsMATLAB: How can i solve a circuit with 2 loops and 2 sources in matlap ( finding I1 and I2) [I1,I2]=solve(2*s*I1+I1-I2+1/s*I1-1/s*I2==1/s,1/s*I2-1/s*I1+I2+3*I2+s*I2==-2/s,I1,I2) % no semicolons at the end MATLAB: How to generate random integer between two no (say 12 and 35) without repeat? randperm(n) give only 1 to n, but I need m to n. idx = 12:35 ;N = length(idx) ;iwant = randsample(idx,N) ; Related QuestionHelp with if-else statementHow to count the white pixels for each column in a binary imageHow to merge a set of struct filesHow to merge two string vectors and get third vectorComposing arrayfun syntax to extract data from structureHow to select specific values of nx3 array where the third dimension contains values in range of 1 to 11 of the 3rd dimension
Best Answer