フィルターのクリア

Updating Matrix in GUI program

1 回表示 (過去 30 日間)
Ali
Ali 2013 年 2 月 28 日
Hi,
I'm working on a GUI project, which I have to update a matrix in separate steps and at the final step calculate the values. In the other word, if I want to explain more, I have a 10*10 matrix that each line have to update in each button press and then move to the next line.
I used asignin() which just update one line and change the previous values or lines to zero.
Now, my question is how can I save my matrix with avoiding to miss the previous values?
Thanks for your time

採用された回答

Jan
Jan 2013 年 2 月 28 日
Instead of ASSIGNIN which is prone to errors, store the matrix using GUIDATA in the figure.
You can set the 'Enable' property of all buttons to 'off', except for the next allowed one. Then the callback of a button disable its own button and enables the following one.
  7 件のコメント
Ali
Ali 2013 年 3 月 6 日
Hi Jan,
Can you please take a look at my code to see what is wrong with that? really need to solve this problem!
Jan
Jan 2013 年 3 月 6 日
What is the problem exactly? I still do not get this.
The 'string' property of the UICONTROLs must be set to a string. Therefore this should be improved:
set(handles.le_value,'string',le_value)
set(handles.x_value,'string',0);
To:
set(handles.le_value,'string', sprintf('%g', le_value))
set(handles.x_value,'string', '0');

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by