Matlab variable viewer does not update structure variables
이전 댓글 표시
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
VBBV
2026년 5월 4일 2:00
@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
2026년 5월 4일 3:07
Mathieu NOE
2026년 5월 4일 11:52
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
2026년 5월 4일 16:51
답변 (1개)
Samar
대략 5시간 전
0 개 추천
Hi Alan,
I understand "Variable Viewer" is not refreshing in MATLAB R2025b and you want a method to force refresh it. This is a known issue and has been discussed in detail in the MATLAB Central Answers here: https://in.mathworks.com/matlabcentral/answers/2180404-cannot-open-variables-from-workspace-in-2025a-b
In the discussion it has been observed that is issue is not consistent and there is no fix as of now. Although there is a workaround that solves the problem. The workaround is to regenerate your MATLAB preferences. You can follow the steps mentioned in the MATLAB Central Answers link here which is answered by MathWorks Staff: https://in.mathworks.com/matlabcentral/answers/99625-how-do-i-regenerate-my-matlab-preferences
Let me know if the issue persists after regenerating the said preferences.
Thanks,
Samar
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!