MATLAB: How to use “or” or Can u pls tell me what is wrong ( just an example) How do i use the or command ? for i = 1:100 if i == 2|5 disp('hallo') end end Best Answer for i = 1:100 if (i == 2)|(i == 5) disp('hallo') endend Related SolutionsMATLAB: “OR” not working This is correct5==1The result is 00|2the result is 1 MATLAB: Pre allocating triple loops n = numel(L);c = cell(n,n,45);for ii = 1:n for jj = 1:n for kk = 1:45 c{ii,jj,kk} = cross(L1(ii,:),a{jj}(kk,:)); end end end Related Question“OR” constraints lsqlinError in resultes of “OR” operatorUsing “or” operands when indexing a matrixGetting an error “INDEX OUT OF BOUNDS” in the matlab program. Please help.If-else statement with several “or” conditions/ comparisons
Best Answer