Here's a very particular function x(t) that came up recently. sin(50mt) x(t) = πί Create a function x=sintt25(t). Define
Posted: Sun May 15, 2022 8:08 pm
USING MATLAB AND CREATING A USER-DEFINED FUNCTION
Here's a very particular function x(t) that came up recently. sin(50mt) x(t) = πί Create a function x=sintt25(t). Define the function to have a single input vector t and output a single output vector x, implementing the function above using a for loop to create each element. %paste in definition from your sintt25.m file %within the loop, use this to avoid trouble at sinx/x if t(i)==0 t(i)=1e-6; favoid sinx/x issue at 0 end
Here's a very particular function x(t) that came up recently. sin(50mt) x(t) = πί Create a function x=sintt25(t). Define the function to have a single input vector t and output a single output vector x, implementing the function above using a for loop to create each element. %paste in definition from your sintt25.m file %within the loop, use this to avoid trouble at sinx/x if t(i)==0 t(i)=1e-6; favoid sinx/x issue at 0 end