MATLAB: What’s the problem codeplot I do not know what the code problem is for not plotting: t=-50:1:50; y=(t.^2+9)/(t-3.^2); plot(t,y,'-k'); Best Answer You forgot to use dot slash to do an element by element divide:t = -50 : 1 : 50;y = (t.^2 + 9) ./ (t-3^2);plot(t, y, 'k-', 'LineWidth', 2);grid on;xlabel('X', 'FontSize', 20);ylabel('Y', 'FontSize', 20);The above code works fine. Related SolutionsMATLAB: What is the code to plot this syms t ezplot(exp(-0.3237*t)*cos(3.4836*t)) MATLAB: How i can make ech turn of the spiral has a different color. Try this:t=linspace(0, 30*pi, 10000);x=t.*cos(t);y=t.*sin(t);colors = hsv(length(t));scatter3(x,y,t, 8, colors, 'filled');grid on;xlabel('x', 'FontSize', 20);ylabel('y', 'FontSize', 20);zlabel('z', 'FontSize', 20); Related QuestionHow to plot real and imag parts for this signal x(t) = cos(t/4)+cos(3*t/4)I need to plot the amplitude of the signalsHow to interpolate in between known data points..How to generate a sin function of time ….
Best Answer