Matlab variable viewer does not update structure variables
Mostra commenti meno recenti
I have been saving data in structures and with my version of Matlab (2025B) it does not seem to update these variables in the viewer. I am currently developing some scripts, so I am essentially just running all the code from the command line. I don't think the code is important; it allocates matrices in a structure based on the data it reads in, and then calculates what the values are. Some psuedo code is below:
NewData='DataSet_X';
Data.(NewData).Value=zeros(size(X,1),2);
for I=1:length(X)
[Data.(NewData).Value(I,1),Data.(NewData).Value(I,2)] = ValueCalcFunction(Dataset X, Ith row)
end
Anyway, if I have Data open in the Variables window It shows the Value field as a matrix full of zeros even after it has been updated. If I double click the field and open just it in the variable window, it shows that it has been updated with the correct values. It would be nice to see it in the structure variable... Here is a screen capture that demonstrates what I mean:

Any ideas how can I force a refresh of the variable viewer?
I have a similar problem with the workspace not updating, but I found I can update it by pressing F5 or chosing Refresh from the menu. These options are not available in the variable viewer.
Thanks!
4 Commenti
VBBV
circa 6 ore fa
@Alan Hoskins Is the pseudo code which you shown present inside another loop ? In that case you would view the variable values as all zeros first before it updates the variable with values
Alan Hoskins
circa 5 ore fa
Mathieu NOE
circa 3 ore fa
have you tried one of these commands :
- refresh — Redraws and updates the current figure or UI, which can also trigger the Variables Editor to update.
- refreshdata — Updates plotted data and linked variables.
Alan Hoskins
circa 9 ore fa
Risposte (0)
Categorie
Scopri di più su Variables in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!