All dear please pay attention if my this question will be solved, percent of accept rate in my question increases to 90%, please help for increasing :))
questuion about cell2html FEX (showing numbers in green and else in black)
1 回表示 (過去 30 日間)
古いコメントを表示
(This question relates on FEX section and sorry for asking here because of giving no answer in that section)
cell2html FEX,Tom Gaudette, is here: http://www.mathworks.com/matlabcentral/fileexchange/4874-cell2html-1-0-r1
Is it possible in this code for showing numbers in green color and string in black?
and while using of characters like '%','\' after converting not shows them. is there a way for supporting them also?
採用された回答
Jan
2011 年 9 月 23 日
You can insert the code for a screen font manually:
C = {1, 4, 17}
D = cell(size(C))
for iD = 1:numel(D)
D{iD} = sprintf('<font color="#00C000">%g</font>', C{iD});
end
Now you have strings instead of numbers, but they contain the tag to write them green.
[EDITED]: Change line 291 to fix the problem with % and \:
% fprintf(fid,['\t\t\t\t',c,'\n']); % Replace with:
fprintf(fid, '\t\t\t\t%s\n', c);
[EDITED 2]: Change all numerical values in your data cell C to strings including the green tag:
for iC = 1:numel(C)
if isnumeric(C{iC};
C{iC} = sprintf('<font color="#00C000">%g</font>', C{iC});
end
end
10 件のコメント
その他の回答 (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!