Matlab variable viewer does not update structure variables
Show older comments
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!
3 Comments
VBBV
27 minutes ago
@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
27 minutes ago
Mathieu NOE
less than a minute ago
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.
Answers (0)
Categories
Find more on Variables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!