Question: 1 Problems: Problem 1 Auto differentiating function - single order Step 1 Write a m - file function named y = Diff ( v ,

1 Problems:
Problem 1
Auto differentiating function - single order
Step 1 Write a m-file function named y=Diff(v,n), where
v is a symbolic single variable
n is a positive integer representing the order of differentiation
y is the nth derivative of the variable in the form of Dnv.
For example.
Step 2 Check for the positive and integer condition of the input n, and if is is not satisfied, then throw an error for it. For this purpose, look for isinf, floor, and error functions.
Step 3 You should convert the symbolic variable v and the number n to strings, and then concent rate that with 'D'. The result string can be turned to a symbolic variable using the mat lab built-in function sym.
Hint: Check the matlab built-in functions sym, char, and num2str help documents. Also, check how can you concentrate multiple strings in MATLAB.
Step 4 write a test script, name it testDiff, m that check the output of the function as the above test script.
 1 Problems: Problem 1 Auto differentiating function - single order Step

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!