I create a new array yet matlab says it exeeds limitations!?

2 次查看(过去 30 天)
Hi, Im creating a large data array to place into a table. It looks like this:
data_flow_table = {colorgen('#FCD5B4','TH B/P'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','TH AB R/O'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','CC allot CFS'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','BA'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.02276');...
colorgen('#FCD5B4','SB'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0644');...
colorgen('#FCD5B4','SL GEN'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','SL PUMP'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','DA'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0114');...
colorgen('#FCD5B4', 'BV'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0201');...
colorgen('#FCD5B4','WR'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0218');...
colorgen('#FCD5B4','WG'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.05057');...
colorgen('#FCD5B4','ED'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.1881');...
colorgen('#FCD5B4','OSO'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.02215');...
colorgen('#FCD5B4','WW'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','WW GEN'), colorgen('#FCD5B4','MW'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','GCIC'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'AL'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'AL GEN'), colorgen('#FCD5B4','MW'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'AL B/P'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','PB'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.055');...
colorgen('#FCD5B4','MJ'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4','MJ GEN'), colorgen('#FCD5B4','MW'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'MJ B/P'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'DC'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.10163');...
colorgen('#FCD5B4', 'DC B/P'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','---');...
colorgen('#FCD5B4', 'LP'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.00569');...
colorgen('#FCD5B4','BH'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.01615');...
colorgen('#FCD5B4', 'DE'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.065');...
colorgen('#FCD5B4','BL'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.065');...
colorgen('#FCD5B4','PO'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.065');...
colorgen('#FCD5B4', 'BS'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0182');...
colorgen('#FCD5B4', 'COR'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.03155');...
colorgen('#FCD5B4', 'GS'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.04587');...
colorgen('#FCD5B4', 'CH'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.04917');...
colorgen('#FCD5B4', 'CV'), colorgen('#FCD5B4','CFS'), colorgen('#FCD5B4','0.0124')};
The colorgen equation is something that colors the individual square - found herehttp://www.mathworks.com/matlabcentral/answers/25038-how-to-change-each-cell-color-in-a-uitable But i keep getting the error 'Index exceeds matrix dimensions.' Why would it be doing this? This is the first time this variable is created, and rewriting an array is so simple. Does anyone see a mistake here?
  3 个评论

请先登录,再进行评论。

采纳的回答

Hannah
Hannah 2013-7-9
编辑:Hannah 2013-7-9
Hi, so i figured out my problem. the function colorgen (received from the page above) was being declared in a function that wasn't being called yet. Thus I assume matlab did not know how colorgen was being defined.
I placed the colorgen function in the opening function of my GUI.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by