필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to remove second digit of first a column

조회 수: 2 (최근 30일)
Vishal Sharma
Vishal Sharma 2017년 1월 24일
마감: Stephen23 2017년 1월 24일
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
Stephen23
Stephen23 2017년 1월 24일
Duplicate:
https://www.mathworks.com/matlabcentral/answers/321691-how-to-remove-second-digit-of-first-a-column

답변 (1개)

KSSV
KSSV 2017년 1월 24일
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

이 질문은 마감되었습니다.

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by