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) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -