I need someone help to draw the flow chart diagram of this matlab code: function dates = dategen(N) m = randi(12,1,N); d

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

I need someone help to draw the flow chart diagram of this matlab code: function dates = dategen(N) m = randi(12,1,N); d

Post by answerhappygod »

I need someone help to draw the flow chart diagram of this
matlab code:
function dates = dategen(N)
m = randi(12,1,N);
dates = zeros(N,2);
i = 1;
while i<N+1 k = m(i);
if k == 2
n = randi(28,1,1);
dates(i,:) = [n k];
elseif k == 4 || k == 6 || k == 9 || k == 11
n = randi(30,1,1);
dates(i,:) = [n k];
else
n = randi(31,1,1);
dates(i,:) = [n k];
end
i = i + 1;
end end
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply