MATLAB: How to solve this simple index problem indexingisnan Hi, I have a=[1;2;3]and b=[23;nan;4] how I can get these c=[2] and also D=[1,23;3,4] Thanks a lot Best Answer idx = isnan(b);c = a(idx);D = [a(~idx), b(~idx)]; Related SolutionsMATLAB: Matrix Simple Index Question Sample inputs:m = 10;n = 13;A = rand(m,n);alpha = .38;Use logical indexingidx = A > alpha;A(idx) = 10;Same applies to a vector (just play around with m and n to see that). MATLAB: Simple for loop index A=[2,4,6,7,9];index=1;for n=[4,9] x(index)=find(n==A); index=index+1;endBest wishesTorsten. Related QuestionSimple inverse indexing question…IndexingIndexingSimple operationsSimple LoopLogical Indexing
Best Answer