Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

How to remove second digit of first a column

2 vues (au cours des 30 derniers jours)
Vishal Sharma
Vishal Sharma le 24 Jan 2017
Clôturé : Stephen23 le 24 Jan 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 commentaire
Stephen23
Stephen23 le 24 Jan 2017
Duplicate:
https://www.mathworks.com/matlabcentral/answers/321691-how-to-remove-second-digit-of-first-a-column

Réponses (1)

KSSV
KSSV le 24 Jan 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

Cette question est clôturée.

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by