Replacing a string
조회 수: 17 (최근 30일)
이전 댓글 표시
I have a set of strings is it possible to replace it by values
for example in excel if i have strings as
private public employed unemployed
is it possible to replace values by 0.1,0.2,0.3,0.4
댓글 수: 0
채택된 답변
TAB
2012년 2월 13일
[num, txt]=xlsread('Book1.xls');
txt=strrep(txt,'private','0.1');
txt=strrep(txt,'public','0.2');
txt=strrep(txt,'unemployed','0.4');
txt=strrep(txt,'employed','0.3');
Val = str2double(txt);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!