how to delete a column from the matrix

3 visualizzazioni (ultimi 30 giorni)
For example, I have a matrix:
a = [1.02 3.04 5.06 0.56; 4.01 2.09 4.07 0.87; 1.03 3.05 4.09 2.08]
and say I want to delete the first column from each row.... how can I do this??.. what will be the syntax for it??...

Risposta accettata

Walter Roberson
Walter Roberson il 8 Giu 2012
a(:,1) = [];
  2 Commenti
Andrei Bobrov
Andrei Bobrov il 9 Giu 2012
a = a(:,2:end);
Ryan
Ryan il 9 Giu 2012
a = (reshape(a',length(a(1,:)),length(a(:,1)-1)))';
or something like that.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by