MATLAB: I want to check the list [2:N] for values that are devisible by 2 and remove those from the list, help plz 2bydevisiblefromlistremove clear; close all clc; N = 10 list = [2:N] x = 2 if (list(list(x) ~= 2) == 'false' list(x) = [] x = x + 1 end Best Answer N = 10;list=2:Nlist(find(mod(list,2)==0))=[]Result:list = 2 3 4 5 6 7 8 9 10list = 3 5 7 9 Related SolutionsMATLAB: Is this while loop not working? Prime number from list because what you want to write in matlab would be like this:while ~isempty(list) MATLAB: Devision of matrix by matrix The bsxfun() command will automatically replicate arrays across the dimensions you need:bsxfun(@rdivide,x,y)I recommend reading "doc bsxfun" to get an understanding of the function. Related QuestionHow to split a (2 x n x m) list of doubles into two separate lists of doubles 2 individual (n x m) lists of doublesDo the values not get added into the array such as [2,3,5,7], but instead they get summed upHow to filter unwanted list from total listMerging two list into one and filling in missing values with [# 0]….Set list box
Best Answer