Sparse subspace clustering (SSC) and low-rank representation (LRR) are the most popular algorithms for subspace clustering. However, SSC and LRR are transductive methods and cannot deal with the new data not involved in the training data. When a new data comes, SSC and LRR need to calculate over all the data again, which is a time-consuming thing. On the other hand, for high-dimensional data, dimensionality reduction is firstly performed before running SSC and LRR algorithms which isolate the dimensionality reduction and the following subspace clustering. To overcome these shortcomings, in this paper, two sparse and low-rank subspace clustering algorithms based on simultaneously dimensionality reduction and subspace clustering which can deal with out-of-sample data were proposed. The proposed algorithms divide the whole data set into in-sample data and out-of-sample data. The in-sample data are used to learn the projection matrix and the sparse or low-rank representation matrix in the low-dimensional space. The membership of in-sample data is obtained by spectral clustering. In the low dimensional embedding space, the membership of out of sample data is obtained by collaborative representation classification (CRC). Experimental results on a variety of data sets verify that our proposed algorithms can handle new data in an efficient way.