Search
 
SCRIPT & CODE EXAMPLE
 

MATLAB

odd even in array matlab

clear all
clc
a=round(0+9*rand(10,1));
for n=1:length(a) % For loop from 1 to length(a), then access each element of a with n, display n
    if mod(a(n),2)==0 
        disp(num2str(n) + " is even")
    elseif n==0  
       disp(num2str(n) + " is 0")
    else
       disp(num2str(n) + " is odd")
    end
end
Comment

PREVIOUS NEXT
Code Example
Matlab :: matlab import data 
Matlab :: matlab tf get poles 
Matlab :: octave return dimensions 
Matlab :: how to multiply matrixes in matlab 
Basic :: how to add basic authentication on haproxy backend server 
Basic :: random numbers visual basic 
Basic :: resttemplate authorization basic 
Basic :: c++ code to c code converter 
Basic :: how to dynamically change the font size of a button visual basic 
Elixir :: elixir length of list 
Elixir :: hello world in elixir 
Elixir :: elixir get nested map value 
Elixir :: elixir string show inner binary 
Scala :: scala match default 
Scala :: sum type scala 
Scala :: scala linters 
Actionscript :: docker compose enable rabbitmq enable plugins 
Excel :: excel number of column 
Perl :: perl post condition 
Perl :: perl 6 
Pascal :: pascal delay 
Powershell :: start-process pwsh 
Gdscript :: godot print enum name 
Cobol :: cobol 
Assembly :: how to open chrome in vbscript 
Assembly :: vba and 
Javascript :: jquery vslidation remove spaces from input 
Javascript :: jquery check if screen size 
Javascript :: Error: Node Sass version 5.0.0 is incompatible with ^4.0.0. 
Javascript :: json object length in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =