How can I change from format [654] to format '654'?
2 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Database Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!