how to catch a matrix to a cell

조회 수: 1 (최근 30일)
Roger
Roger 2014년 3월 18일
댓글: Roger 2014년 3월 18일
if true
s={'CD2','GYA','LZH','GOM','XAN'};
p=[234 44 56 33 67];
end
i want get a cell like this
s={'CD2:234','GYA:44','LZH:56','GOM:33','XAN:67'};
do u have any idea?
  댓글 수: 1
Roger
Roger 2014년 3월 18일
or how to change p to {'234' '44' '56' '33' '67'},this will also help

댓글을 달려면 로그인하십시오.

채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 3월 18일
편집: Andrei Bobrov 2014년 3월 18일
strcat(s,{':'},arrayfun(@num2str,p,'un',0))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by