MATLAB: How can I make the line animated for x2, y2 animatedlinemoving x=[0 100 100 0 0]; y=[0 0 100 100 0]; x1=[50 50 50 50 50 60 70 80 80 80 80 80]; y1=[0 10 20 30 40 40 40 40 50 60 70 80]; plot(x,y,x1,y1) Best Answer x=[0 100 100 0 0]; y=[0 0 100 100 0]; x1=[50 50 50 50 50 60 70 80 80 80 80 80]; y1=[0 10 20 30 40 40 40 40 50 60 70 80]; plot(x,y);hold onfor i = 1:length(x1) plot(x1(1:i),y1(1:i),'r') pause(0.2)end Related SolutionsMATLAB: How to find a slope of signal if we do not know the value of x1, x2, y1, y2 I am not certain what you intend by ‘slope of a signal’. You can easily determine the derivatives of the signal with the gradient (link) function. MATLAB: Send data to an output file (.txt) using fprintf fprintf ( fid, '%i', c1 ); % will write "120" to your filefprintf ( fid, '%i x%i', c1, i ); % will write "120 x1"that should be enough to give you an idea how to progress Related QuestionX2 and y2 not plotting as expectedHow to plot a graph within a certain rangeHow to load a dat file which includes NaN valueFind optimized x1, x2, x3 for a given y.Can anyone answer why don’t the grid on the surface is not coming in this 3D plot
Best Answer