필터 지우기
필터 지우기

How can I change from format [654] to format '654'?

조회 수: 1 (최근 30일)
Ines
Ines 2012년 6월 6일
Dear all, being new to matlab i am a bit confused about the different formats...i want to perform a string comparison with strcmp but it doesnt work..I think its because the numbers are in the wrong format, the matlab output says they are like this: A= [654] I usually thought the latter was numeric but applying isnumeric(A) returns a 0...all the values are in a cell-matrix....I think I need to make A='654', how can I do this?
Thank u very much!

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 6월 6일
A= 654;
A = num2str(A);
if A - cell array with double values:
A = {526 698};
A = cellfun(@num2str,A,'un',0);
  댓글 수: 1
Ines
Ines 2012년 6월 6일
Thank u very much, that works great :)

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by