if statement - Simple code on Octave -


in case u vector of random numbers

 i=u     if (i<1)       i=i+1     endif   endfor 

in end gives me vector i=u

if trying count number of elements less 1 then:

sum(u < 1) 

or if wanted use loop need separate variable total:

count = 0 = u     if < 1         count = count+1;     end end 

Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -