I need someone to design the Flowchart for this Matlab code: function dates = dategen(N) m = randi(12,1,N); dates = zero

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 to design the Flowchart for this Matlab code: function dates = dategen(N) m = randi(12,1,N); dates = zero

Post by answerhappygod »

I need someone to design the Flowchart for 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