How to get rid of double quotes from cell array
26 ビュー (過去 30 日間)
古いコメントを表示
hello, everybody
I would like to get rid of double quotes from cell array. The Output will be cell array without double quotes.
Is it possible to remove it?
% For example I have a 8×1 cell array "exp". How to get rid of double quotes of m and L and c ?
exp = {"m", 10, 20, "L", 0, "c" 0, 0}';
% Output will be cell array of {m, 10, 20, L, 0, c 0, 0}
exp = strrep(exp(:,1),'"',''); % error Occures.
3 件のコメント
DGM
2023 年 1 月 3 日
編集済み: DGM
2023 年 1 月 3 日
It appears you have a mix of strings and numeric scalars. There are no double quotes in the strings. As Stephen says, that's how strings are displayed. Strings are created and displayed using double quotes. Character arrays are created and displayed using single quotes.
mystring = "This string contains -->""<-- one double quote"
mychar = 'This char vector contains -->''<-- one single quote'
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!