Let's say we have matrix A=[1 2 3; 4 5 6; 7 8 9; 10 11 12], and b a number the user is inserting.
I want to delete 1st row if b=1, or delete the 2nd row if b=2 etc. Is this possible?

 Respuesta aceptada

madhan ravi
madhan ravi el 9 de Mayo de 2019
Editada: madhan ravi el 9 de Mayo de 2019

2 votos

A=[ 1 2 3;...
4 5 6;...
7 8 9;...
10 11 12]
b=2;
A(b,:)=[]

Más respuestas (1)

Categorías

Etiquetas

Preguntada:

el 9 de Mayo de 2019

Editada:

el 9 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by