MATLAB: I have some problem when plotting the graph, anyone can help? Thanks for loop This is my code for x = -10:10 y = 2^(0.4*x)+5 plot(x,y,'g')end Best Answer Hi,You need to store y first.x = -10:10;for i = 1:numel(x) y(i) = 2^(0.4*x(i))+5endplot(x,y,'g') Related SolutionsMATLAB: Anyone can answer? Thanks k = importdata ('data.txt') ; MATLAB: Having problem with empty matrix…Can anyone help The problem is that you are encountering floating point approximation error.If you do the comparison:x_error = x(4) - 0.6x_error = 111.0223e-018The solution is to allow for the tolerance. The easiest way is to change your ‘idx3’ assignment to:idx3=find((x<=0.6),1,'last')which works.For a thorough discussion, see Why is 0.3 - 0.2 - 0.1 (or similar) not equal to zero? Related Question‘Subscripted assignment dimension mismatch” error..can anyone helpMultiplication implementation help
Best Answer