MATLAB: Plotting selected columns of a matrix columsmatrixplot I have a 32×1544 matrix. I want to plot the 1st 8 column as plot1, 2nd 8 columns as plot2 and the 3rd 8 columns as plot3. So all the 3 seperate plots are 32×8 2D-plot Please advise. Thanks Best Answer I am not certain what you want as the result. Try this: M = rand(32,24) + (1:24); % Create Matrixx = 1:32; % Independent Variable Vectorfigurefor k = 1:3 subplot(3,1,k) plot(x, M(:,(1:8)+(k-1)*8)) gridendSubstitute your own matrix for ‘M’, and your independent variable vector for ‘x’. Related SolutionsMATLAB: If I have an array that is size 2×60, how to plot row 2 vs. row 1 Would it beplot(data(2,:),data(1,:))Yes if you want row 2 as the x (independent) variable and row 1 as the y (dependent) variable. Otherwise, reverse them. MATLAB: Plot a 6×6 matrix in 3D N=6;[X,Y]=meshgrid(1:N,1:N);surf(X,Y,A);or plot3(),contour() depending what illustration you want. Related QuestionHow to plot a matrix with vector ?
Best Answer