MATLAB: Error using plot ; spectrum of function plot Why I get error using the following code? syms t w;syms g h;g=fourier(exp(-1*(t^2)));h=abs(g);w=-10.1:10.1;plot(w,h); Best Answer plot(w, subs(h)) Related SolutionsMATLAB: Plotting dirac delta function’s spectrum The Fourier (and Laplace) transforms of the Dirac delta function are uniformly 1 for all omega (or ‘s’).That is the result you get in ‘g(w)’. MATLAB: Fplot differentiated symbolic equation I would calculate the derivative and create the anonymous function for ‘Vg’ with:Vg = matlabFunction(diff(Mg,t), 'Vars',{t});With that change, it runs without error, although the plot generates a long ‘Warning’ message. Related QuestionTrouble using ezplot and matlabFunction on a symbolic function defined using symengine “piecewise”How to plot a sym function with constant function such as x=2(vertical line) & y=3(horizontal line)
Best Answer