Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I do not know what I am doing wrong. Could someone tell me if I am putting the function the right way? 3.14 Piecewise functions
I do not know what I am doing wrong. Could someone tell me if I am putting the function the right way?
3.14 Piecewise functions are sometimes useful when the re- lationship between a dependent and an independent variable cannot be adequately represented by a single equation. For example, the velocity of a rocket might be described by 101 - 51 05158 624 - 36 851516 v(t) = 361 + 12(t-16) 16 26 otherwise Develop an M-file function to compute v as a function of t. Then, develop a script that uses this function to generate a plot of v versust for t = -5 to 50. 0 1 2 - 3 Till III function v=piecewise Fun (t) if t>= 0 & t=8 & t=16 & t26 v=2136*exp(-0.1* (t-26)); else v=0; 10 - 11 - 12 - 13 - end end Command Window DLLUL 111 piecewiser un if t>= 0 & t> piecewiseFun Not enough input arguments. Error in piecewiseFun (line 2) if t>= 0 & t> velocityplot Unrecognized function or variable 'velocity'. Error in velocityplot (line 5) v(i) = velocity (t(i)); fx >> 1 - t = -5:50; v = []; 2 3 4 - 5 F for i=1:length(t) v(i) = velocity (t(i)); end 6 - 7 8 - plot(t, v) Command Window DILUL 111 piecewiser un if t>= 0 & t> piecewise Fun Not enough input arguments. Error in piecewise Fun (line 2) if t>= 0 & t> velocityplot Unrecognized function or variable 'velocity'. Error in velocityplot (line 5) v(i) = velocity (t(i)); fx >>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