Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

How to remove second digit of first a column

2 visualizaciones (últimos 30 días)
Vishal Sharma
Vishal Sharma el 24 de En. de 2017
Cerrada: Stephen23 el 24 de En. de 2017
I have one matrix A = [21 2; 34 3; 13 4] I want to remove first digit of first column, so that result shall be A= [1 2;4 3; 3 4]
  1 comentario
Stephen23
Stephen23 el 24 de En. de 2017
Duplicate:
https://www.mathworks.com/matlabcentral/answers/321691-how-to-remove-second-digit-of-first-a-column

Respuestas (1)

KSSV
KSSV el 24 de En. de 2017
A = [21 2; 34 3; 13 4] ;
B= [1 2;4 3; 3 4] ;
iwant = A ;
for i = 1:size(A,1)
tmp=str2double(regexp(num2str(A(i,1)),'\d','match')) ;
iwant(i,1) = tmp(2) ;
end
iwant

La pregunta está cerrada.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by