Variable Explorer does not update values when changing properties (2025a/b)

38 views (last 30 days)
I have a problem with the current version of variable explorer:
Whenever I use debug mode to assess the behavior of the object constructor, I cannot observe the object in the variable viewer simultaneously because the properties are not updated in there when changed/assigned by e.g. stepping through the constructor steps or using the console.
The properties themselves are updated (as can be checked through variable explorer by opening the individual properties themselves), but that change is now shown in the "obj" variable in variable viewer. However, closing and reopening "obj" in the variable viewer does update the properties in variable viewer. This is of course all in the function workspace of the constructor, if I understand this correctly.
UPDATE: I just noticed this behavior does not only refer to constructor functions, but class functions/methods in general. I've updated the examples accordingly. The behavior can be observed in both calls independently in debug mode.
As far as I remember, this behavior was not the same in previous version of MATLAB. Is there any setting or flag that I have to update to be able to debug the contructor behavior step-by-step without having to reopen the variables over and over again?
I've written a simple test class and constructor to reproduce this behavior down below. The behavior is also completely disregarding of property type.
Test Class:
classdef test_class
%TEST_CLASS Summary of this class goes here
% Detailed explanation goes here
properties
Property1 = 5
Property2 = 'test'
Property3 = [1 2; 3 4]
Property4 = {[1 2 3], [1 2 3 4 5 6]}
end
methods
function obj = test_class(inputArg1,inputArg2)
%TEST_CLASS Construct an instance of this class
% Detailed explanation goes here
obj.Property1 = inputArg1 + inputArg2;
obj.Property2 = 'var test';
obj.Property3(2) = 5;
obj.Property4{1} = [1 2 3 4];
obj.Property4{2}(3) = 8;
end
function method1(obj,inputArg)
%METHOD1 Summary of this method goes here
% Detailed explanation goes here
obj.Property1 = inputArg;
obj.Property3(3) = inputArg;
end
end
end
Simple Call:
test_var = test_class(4, 5);
test_class.method1(10);
  2 Comments
dpb
dpb on 9 Feb 2026 at 14:19
Edited: dpb on 9 Feb 2026 at 14:32
Numerous issues/bugs have been reported in the revised Variable Explorer, but it probably doesn't hurt to have another specific example, especially with example/test code.
Submit this to Mathworks as an official support request/bug at <Product Support Page>
Tim
Tim on 9 Feb 2026 at 14:36
Aah, so it's a bug then, I thought there might be some option to toggle this.
Sure, I just wrote a bug report, thanks for the heads up.

Sign in to comment.

Answers (0)

Categories

Find more on Results, Reporting, and Test File Management in Help Center and File Exchange

Products


Release

R2025b

Community Treasure Hunt

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

Start Hunting!