suppose I have a matrix [1 2 3 4 5; 6 7 8 9 0; 2 4 6 7 8]
now i want to cut and have the matrix [3 4 5; 8 9 0; 6 7 8] what should i do??

4 comentarios

Jan
Jan el 11 de Nov. de 2012
This is a question which is answered, when you read the "Getting Started" chapters of the documentation. It is strongly recommended to do this, when you want to work with such a powerful tool as Matlab.
smit g
smit g el 12 de Nov. de 2012
thanks for ur suggestion..actually in our college we are given 1000s of assignment in a span of very few days...so no time to read documentation...I just search the net to find such small things because there is no one to help.I needed this for hamming code simulation.I will surely go through it during my holidays.....
Jan
Jan el 12 de Nov. de 2012
Editada: Jan el 12 de Nov. de 2012
1000s of assignments in a few days?! This system does not allow to learn efficiently. Surely you will not remember anything you can answer now in 2 years (or to be exact: anything the forum can answer). Using the holidays to read the documentation is a bad idea also: The brain needs vacations for a general brush-up.
I'm not convinced, that your college is a good preparation for the real live in a scientific community. So I wish you the very best and good luck. Please let your children visit a different college.
Camilo Malagon-Nieto
Camilo Malagon-Nieto el 18 de Mayo de 2017
It is a valid question. I am using Matlab for quite some time and I just forgot how to do it. and I prefer to search here that go to the library, loan a MatLab book, look for the answer in the many chapters.... and so on.

Iniciar sesión para comentar.

 Respuesta aceptada

Wayne King
Wayne King el 11 de Nov. de 2012
Editada: Wayne King el 11 de Nov. de 2012

3 votos

Let
A = [1 2 3 4 5; 6 7 8 9 0; 2 4 6 7 8];
B = A(:,3:end);

2 comentarios

smit g
smit g el 11 de Nov. de 2012
thanks......
Wouter
Wouter el 15 de Mayo de 2017
This solution, though simple, forces matlab to copy all the remaining elements through the memory. Is there no more memory-friendly solution for large matrices to chop columns out of A without copying the remaining elements?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 11 de Nov. de 2012

Comentada:

el 18 de Mayo de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by