Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objective: This activity has the purpose of helping students to create functions in the programming language, save a function created by yourself and use it
Objective: This activity has the purpose of helping students to create functions in the programming language, save a function created by yourself and use it in a main program and create a function that is activated with the help tool and explain to the user how it works. Student Instructions: 1. Identify your work with your personal data (Name, last name, student id number). 2. Save the function and title CP_\# where the number is your id student number. 3. Add comments to the function that describe the purpose and variables of the function and can be useful for the help tool. 4. Copy the main program code and the function program in the same word page. Attached both .m programs. 5. This activity will have one (1) attempt. 6. Total value of 15 points. 7. This programs will be delivered via "Assignment" in Blackboard. 8. The deadline for this activity can be found in "Tools" located in "Calendar" in the Blackboard platform. From textbook problem 29 page 217 Gilat, A. The concentration of a drug in the body Cp can be modeled by the equation: Cp=VdDG(kake)k(eketekat) Where DG is the dosage administrated (mg), Vd is the volume of distribution (L), ke is the absorption rate constant (h1),ka is the elimination rate constant (h1), and t is the time (h) since the drug was administered. Create a function that bring as output the concentration of a drug in the body at time required. For a certain drug, the following quantities are given: DG150mg,Vd=50L,ke=0.4h1,ka=1.6h1 Write as a function introduction in the comment space for help tool: The function input variables The function output variables The purpose of the function Add inside the function algorithm the command nargin Nargin (number of argument in), is very useful to verifying if the user enter the correct quantity of argument in the function. As example if the function need 3 argument add in the function: if nargin =3 errordlg('Not enough input arguments') end For more practice, refer to the textbook Gilat, A. (2015). MATLAB, An Introduction with Applications: 5th edition. Wiley chapter 7
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started