Matlab: Find the errors - debug the given code. Follow the instructions of a. b.
ID: 3784571 • Letter: M
Question
Matlab: Find the errors - debug the given code. Follow the instructions of a. b. c. at the bottom. Provide a clear explanation of both plots and a. and b. as well as comments throughout your work process. PLEASE BE VERY CLEAR..
ANSWER IN MATLAB CODE ONLY. ONLY ANSWER IF YOU CAN PROVIDE BOTH PLOTS FOR A AND B. DONT BOTHER ANSWERING IF YOU DON'T KNOW.
you literally have to find the errors in the given code and that pretty much solves part a. part b is just another step after that..
AMATLAB script is provided below, which does the following: a. Defines all problem parameters. For this problem, the drag coefficient is set to c 12.5 kg/s and the parachutist's mass m is equal to 75Kg. Plots the exact, analytical solution for this problem over the range 0 tot 60 s. The algorithm below has several errors. Correct them and create one plot showing the analytical solutions function EDD parachutist close all define constants g 10 in/s 21 to tend 60 step l dt in analytical solution -t 0:tend. (l-exp plot analytical solution figure plot (t hold ylabel Time (s Font Weight bold xlabel. velocity v (t) Fontieight bold') numerical solution velocity] f dd (step, tend, g, 2 plot numerical solution plot (velocity 1) r velocity 21 'g') title Parachutist Example Terminal Velocity Exact Va Numerical Font weight bold. legend It Nume Exact 'J) tunction Lvelocity toid step,tend, g, c,m rinite divided dirrerence approxima t1 on velocity 10,01: for i 1:h: tend start for loop from 1 velocity [velocity li,v)] ena endExplanation / Answer
L 22 (C 1-9): The value assigned here to variable 'nothandle' might never be used. L 23 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)). L 24 (C 5-11): 'notline' might be growing inside a loop. Consider preallocating for speed. L 24 (C 44-49): Use STRCMPI(str1,str2) instead of using LOWER in a call to STRCMP. L 28 (C 12-15): NUMEL(x) is usually faster than PROD(SIZE(x)). L 34 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed. L 34 (C 24-31): Use dynamic fieldnames with structures instead of GETFIELD. Type 'doc struct' for more information. L 38 (C 29): Use || instead of | as the OR operator in (scalar) conditional statements. L 39 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements. L 40 (C 47): Use || instead of | as the OR operator in (scalar) conditional statements. L 42 (C 13-16): 'data' might be growing inside a loop. Consider preallocating for speed. L 43 (C 13-15): 'dim' might be growing inside a loop. Consider preallocating for speed. L 45 (C 13-15): 'dim' might be growing inside a loop.Consider preallocating for speed. L 48 (C 52): There may be a parenthesis imbalance around here. L 48 (C 53): There may be a parenthesis imbalance around here. L 48 (C 54): There may be a parenthesis imbalance around here. L 48 (C 55): There may be a parenthesis imbalance around here. L 49 (C 17): Terminate statement with semicolon to suppress output (in functions). L 49 (C 23): Use of brackets [] is unnecessary. Use parentheses to group, if needed.