Store a vector in one function and access it from another function in Appdesigner.

1 次查看(过去 30 天)
I have a 1x40001 size vector "I" in one function that is calculated using a Gaussian distribution. I need to store this in memory and recall it in another function. In the old GUIDE it would have probably been something like this:
% --- Executes on button press in pushbutton4.
function pushbutton1_Callback(hObject, eventdata, handles)
... I = "Gaussian function" ...
handles.I = I; % store vector in handles
guidata(hObject, handles); % save handles
end
function pushbutton2_Callback(hObject, eventdata, handles)
I = handles.I; % get vector from handles
...
end
But in Appdesigner a simple line
app.I = I;
is not working for storing.
Do I need to create an Edit Field Callback and store the vector value in it or there is a simpler solution?

采纳的回答

Steven Lord
Steven Lord 2021-1-18
  1 个评论
zeytun
zeytun 2021-1-18
Thank you! I just had to create a property with a name "I2", and then later in the code, right after I calculated the vector "I", I had to add the line.
app.I2 = I;

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by