|
From: Scott S. <sco...@gm...> - 2009-10-27 11:09:09
|
>2009/10/27 Piter_ <x....@gm...>: > I have a matrix M: > First column is X ans the rest are Ys. Lets say 100 of them (1000 > sometimes). > So far I can plot it like > plot(M(:,1), M(:,2),M(:,1),M(:,3)... and so on and so on) > Is there any possibility to do it in matlab way? Like: > > plot(M(:,1),M(:,2:end)) Hi Piter, Does the following do what you want? >>> import numpy as np >>> import matplotlib.pyplot as plt >>> x = np.arange(10) >>> y = np.random.random((10, 5)) >>> M = np.column_stack((x, y)) >>> plt.plot(M[:, 0], M[:, 1:]) >>> plt.show() Python indices start from zero, Matlab indices start from 1. Cheers, Scott |