2016-12-09 15 views
0

文字列を数値に変換するにはどうすればよいですか? number_of_plots = '4'しかし、私はあなたが数値に文字列を変換するためにstr2numを使用することができますMatlab:文字列を数値に変換する方法

Tabel_Cell = table2cell(diagramoptions) ; 
idx= strfind(Tabel_Cell(:,1), 'number_of_plots'); 
idx = find(not(cellfun('isempty',idx))); 
number_of_plots = Tabel_Cell{idx,2} 
%number_of_plots1=double(number_of_plots); 
%number_of_plots1=str2num(number_of_plots); 

答えて

2

'' なしをしたいです。

あなたはむしろstr2num

+0

よりも高速であるstr2double(より安全な)を使用するフロートに変換したい場合は、あなたに感謝し、高速動作します – Lutz

関連する問題