MATLAB: Inline to Anonymous Function anonymous functionsinline()MATLABplots How can I use anonymous functions to make this plot? clear all;clc; x =inline('5*sin(2*pi*1*t).*exp(-.4*t)','t'); t = (-10:.01:10); plot(t,x(t)); xlabel ('t (seconds)'); ylabel ('Ámplitude'); Best Answer Simply replace your x = inline... etc expression withx = @(t) 5*sin(2*pi*1*t).*exp(-.4*t); Related SolutionsMATLAB: Plotting a function with input and output You need to change * to .* and change e to exp(), and you need to move the 5 exponent:t=0:0.01*pi:20*pi; % Create t[x, y] = bird(t); % Call the function.function [x,y] = bird(t)x = sin(t) .* (exp(cos(t)) - 2*cos(4*t)-sin(t/12).^5)y = cos(t) .* (exp(cos(t)) - 2*cos(4*t)-sin(t/12).^5)plot(x,y)end MATLAB: Inline.inline at 47 syms xfun = sym( get(handles.edit4,'String') );f = matlabFunction(fun, x);dfun = diff( fun, x );df = matlabFunction(dfun, x); Related QuestionWhat is wrong with the code, i am trying to plot belowWhat’s wrong with this scriptCalculations using Inline FunctionsInline VS anonymous functions
Best Answer