You can use cellfun with strrep function to replace every double quote mark with a single quote mark in a cell array in MATLAB. Here's an example:
main.m252 chars9 lines
Output:
main.m48 chars3 lines
Here, we first create a sample cell array myCellArray
containing two strings, each containing double quotes. We then use the cellfun
function to apply the strrep
function on each element of myCellArray
. The strrep
function replaces every occurrence of the double quote mark ("
) with the single quote mark ('
). Finally, we set the 'UniformOutput'
option of cellfun
to false
to indicate that the output should be a cell array (rather than a matrix).
gistlibby LogSnag