passing data from one fig file to another

1 回表示 (過去 30 日間)
Jack
Jack 2011 年 3 月 26 日
移動済み: DGM 2024 年 10 月 1 日
in my program using guide i have created 2 gui files one, one does the calculating and sorting the result in order. then i want to view the result of the calculations on a result page which i have created (my second gui) i just want help in transferring the calculation matrix to the results page gui.
i tried the following
after the calculation i called the second gui
a={'123.5','456','743' '432.9', '109','39'};
result(a);
call second gui i debugged it and i saw the variable went to the second m file of the second gui stored in varargin but not the matrix but something like 2x3 cell is stored how do i convert it back to matrix so i can use it in the second m file.and how would i use it in the opening function of the gui as it is not global variable.
help would be appreciated if there was an easy way to pass this matrix from m file to another m file when executing the first m file

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 3 月 26 日
Are you sure you want to pass you data as strings and not as numeric data? A set of variable-length strings has to be passed as a cell array, so the cell array you saw in the second gui might have been what you were passing.
  1 件のコメント
Jack
Jack 2011 年 3 月 26 日
移動済み: DGM 2024 年 10 月 1 日
it doesn't matter i alread solved the problem i just wanted to find a way to pass any variable from one m file to another .
i just looked at example codes and found the following
result();
varargin=2x3cell
data=varargin{1} because varargin is a 1x1 cell
data='123.5' '456' '743' '432.9' '109' '39'
if i add result(a,'hello','3043')
in other m file you write [a v c] = varargin{1:3}
thanks for the quick response and help

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

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by