MATLAB: Plot values exception [x1 x2 x3 …] exception valuesplot I have x=1:100 and xx=[2 5 8 13 14 25 46 78 97 99] (whatever) How to plot(x, '.b') (or scatterplot) to suppress xx values on x Best Answer Assuming you mean that xx refers to the indices (i.e. locations in x, not the values of x), then this should work:indicesToInclude = setdiff(1:100,xx);plot(x(indicesToInclude),'.b') Related SolutionsMATLAB: Plotting loops, but only empty plot Add ‘x’ as an index to create your ‘x1’ vector, and specify x2 as a vector outside the loop:x = 1; while x<19; x1(x) = x; y1(x)=x1(x)^3-(5*x1(x))^2+2^x1(x)-10000*x1(x); x=x+1; endfor x2=1:20 y2(x2)=20000*log(x2)-3*x2;endx2=1:20;%Create the plotfigure plot(x1,y1,'b-',x2,y2,'k-') MATLAB: TAKING [X1 X2 …] and [Y1 Y2 …] and reshaping them into [Y1 X1 Y2 X2 …] xy = reshape([y;x],1,[]); Related QuestionDimensions of matrices being concatenated are not consistent.I need to plot solid/black, solid/red, dashed/black and dashed/red for x1 x2 x3 and x4. How to plot dashReshape: Math lesson helpFunction handling problem in loop
Best Answer