1. Homepage
  2. Exam
  3. [2019] ENG 1002 Programming (Matlab and C) - Semester 1 - Primary Examination - Q2 Matlab Iteration

[2019] ENG 1002 Programming (Matlab and C) - Semester 1 - Primary Examination - Q2 Matlab Iteration

This question has been solved
Engage in a Conversation

Question 2
Iteration
CourseNana.COM

(a) Write a MATLAB script, using either a single or nested for-loop, that will print the factorials for the numbers between 1 and 100 (inclusive). The factorial of n (n!) is the product of the positive integers less than or equal to n. For example: 3! = 3 * 2 * 1. For this question you cannot use the built- in MATLAB factorial function, but you can use other MATLAB functions if you wish. [6 marks] CourseNana.COM

(b) Write a MATLAB while-loop that iteratively decrements a variable called counter by 1 until counter becomes negative. [3 marks] CourseNana.COM

(c) You are writing a control program that checks a temperature sensor’s values until the reading reaches 100C. Would you use a for-loop or while-loop for this application? Explain why. [3 marks] CourseNana.COM

[Total for Question 2: 12 marks] CourseNana.COM

Get the Solution to This Question

WeChat WeChat
Whatsapp WhatsApp
The University of Adelaide代写,ENG 1002代写,Programming (Matlab and C)代写,C代写,Matlab代写,The University of Adelaide代编,ENG 1002代编,Programming (Matlab and C)代编,C代编,Matlab代编,The University of Adelaide代考,ENG 1002代考,Programming (Matlab and C)代考,C代考,Matlab代考,The University of Adelaidehelp,ENG 1002help,Programming (Matlab and C)help,Chelp,Matlabhelp,The University of Adelaide作业代写,ENG 1002作业代写,Programming (Matlab and C)作业代写,C作业代写,Matlab作业代写,The University of Adelaide编程代写,ENG 1002编程代写,Programming (Matlab and C)编程代写,C编程代写,Matlab编程代写,The University of Adelaideprogramming help,ENG 1002programming help,Programming (Matlab and C)programming help,Cprogramming help,Matlabprogramming help,The University of Adelaideassignment help,ENG 1002assignment help,Programming (Matlab and C)assignment help,Cassignment help,Matlabassignment help,The University of Adelaidesolution,ENG 1002solution,Programming (Matlab and C)solution,Csolution,Matlabsolution,