is it possible aarays in first row and first column of a cell be writen in red or other color?

4 ビュー (過去 30 日間)
is it possible, aarays in first row and first column of a cell, be writen in red or other color while seeing .mat of that?

回答 (4 件)

Walter Roberson
Walter Roberson 2011 年 9 月 5 日
Unfortunately Foreground Color applies to all cells, not selectively.
Individual cells can be colored using undocumented Java techniques, or by the official HTML method
  1 件のコメント
mohammad
mohammad 2011 年 9 月 5 日
Walter please see my message in Answer3 ( because of making code i cant comment)

サインインしてコメントする。


Walter Roberson
Walter Roberson 2011 年 9 月 5 日
Sorry, I did not notice before that you were not using uitable.
It is not possible to color array members in .mat files.
In order to color objects in .xls files, you must be using MS Windows and you must have Excel installed, and you must use COM objects to communicate directly with Excel in order to invoke the Excel commands that would be used to color the cells.
  1 件のコメント
mohammad
mohammad 2011 年 9 月 5 日
nice!
i use win and also Excel installed
could you tell me by which command i do this? (sorry i am beginner in matlab)

サインインしてコメントする。


Harry MacDowel
Harry MacDowel 2011 年 9 月 5 日
I think that has something to do with the display of the data rather than the content of the data.
What I know is, in GUI, you can utilize the uitable format, change the display of the Foreground Color, so that is a certain yes for GUI.
As for the Matlab command window, you would have to alter it using fprintf etc.
There is a very useful command call cprintf on File Exchange and the documentation could be found here: http://undocumentedmatlab.com/blog/cprintf-display-formatted-color-text-in-command-window/
I think it is a good try. Go for it.

mohammad
mohammad 2011 年 9 月 5 日
i have 'Find' in under form that, is saved in .xls and .mat format in a specified folder and the 'Value' of 'Find' in 'Workspace' is '<12x3 cell>'. i need first row and first column of 'Find' that includes references names and inputs names in a color like red. i studied "Individual cells can be colored using undocumented Java techniques, or by the official HTML method" that has been suggested by Walter but where must i put 'Find' in multi_colored_uitable function (in the official HTML method) and how must 'Find' define for this function? and its good for me also first row and column be colored in related .xls and .mat file.
Find =
'Refrences\Inputs ' 'a.xls' 's.xls'
'R1.xls' ' M' ' N'
'R2.xls' ' N' ' N'
'3.xls' ' N' ' M'
'4.xls' ' N' ' N'
'R5.xls' ' N' ' N'
'6.xls' ' N' ' M'
'7.xls' ' N' ' N'
'R8.xls' ' N ' L'
'9.xls' ' M' ' N'
'10.xls' ' L' ' N'
'11.xls' ' N' ' N'
  2 件のコメント
Harry MacDowel
Harry MacDowel 2011 年 9 月 5 日
have you tried the cprintf function I suggested?
mohammad
mohammad 2011 年 9 月 5 日
thanks a lot dear Harry
i think cprintf is for command window
if its possible to aplly cprintf.m to rows and columns of 'Find', please help me

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by