Month: April 2026
Can I use the Simulink Solver profiler programmatically?
I want to view Solver Profiler output for a variety of Simulink simulations, and currently I am running them one by one in the Solver Profiler window to achieve this. I would like to batch run them overnight and view profiler results afterwards, is this possible?I want to view Solver Profiler output for a variety of Simulink simulations, and currently I am running them one by one in the Solver Profiler window to achieve this. I would like to batch run them overnight and view profiler results afterwards, is this possible? I want to view Solver Profiler output for a variety of Simulink simulations, and currently I am running them one by one in the Solver Profiler window to achieve this. I would like to batch run them overnight and view profiler results afterwards, is this possible? simulink profiler, command line MATLAB Answers — New Questions
listdlg in MATLAB R2025b returns selected indices in click order instead of ascending order
In MATLAB R2025b, listdlg appears to return the selected indices in the order the user clicked them, rather than in ascending numeric order.
In older versions such as R2022b and R2024a, the returned indices were ordered ascendingly, which made the behavior predictable and easy to work with in downstream code.
This change caused nasty bugs in existing code on my side, because I use the returned indices to index into related lists that assume a consistent ascending order. With the new behavior, the item order can differ depending on click sequence, which breaks code that previously worked correctly.
Minimal example:
[idx, tf] = listdlg( …
‘ListString’, {‘A’,’B’,’C’,’D’,’E’}, …
‘SelectionMode’, ‘multiple’);
disp(idx)
In R2025b, if I click items in the order 2, 1, 3, the result is: [2 1 3] -> Which leads to calling [‘B’, ‘A’, ‘C’] in downstream code
Whereas in older releases it was always: [1 2 3]
Questions:
Is this behavior change intentional in R2025b? I cannot find any documentation on that.
Is there a way to restore the old ascending-order behavior globally, for example via a preference or in startup.m?
Or is the only safe solution now to wrap every listdlg call with sort(idx) manually?
I can work around this with sort, but it would be very helpful if there were a default compatibility option, especially for larger existing codebases.In MATLAB R2025b, listdlg appears to return the selected indices in the order the user clicked them, rather than in ascending numeric order.
In older versions such as R2022b and R2024a, the returned indices were ordered ascendingly, which made the behavior predictable and easy to work with in downstream code.
This change caused nasty bugs in existing code on my side, because I use the returned indices to index into related lists that assume a consistent ascending order. With the new behavior, the item order can differ depending on click sequence, which breaks code that previously worked correctly.
Minimal example:
[idx, tf] = listdlg( …
‘ListString’, {‘A’,’B’,’C’,’D’,’E’}, …
‘SelectionMode’, ‘multiple’);
disp(idx)
In R2025b, if I click items in the order 2, 1, 3, the result is: [2 1 3] -> Which leads to calling [‘B’, ‘A’, ‘C’] in downstream code
Whereas in older releases it was always: [1 2 3]
Questions:
Is this behavior change intentional in R2025b? I cannot find any documentation on that.
Is there a way to restore the old ascending-order behavior globally, for example via a preference or in startup.m?
Or is the only safe solution now to wrap every listdlg call with sort(idx) manually?
I can work around this with sort, but it would be very helpful if there were a default compatibility option, especially for larger existing codebases. In MATLAB R2025b, listdlg appears to return the selected indices in the order the user clicked them, rather than in ascending numeric order.
In older versions such as R2022b and R2024a, the returned indices were ordered ascendingly, which made the behavior predictable and easy to work with in downstream code.
This change caused nasty bugs in existing code on my side, because I use the returned indices to index into related lists that assume a consistent ascending order. With the new behavior, the item order can differ depending on click sequence, which breaks code that previously worked correctly.
Minimal example:
[idx, tf] = listdlg( …
‘ListString’, {‘A’,’B’,’C’,’D’,’E’}, …
‘SelectionMode’, ‘multiple’);
disp(idx)
In R2025b, if I click items in the order 2, 1, 3, the result is: [2 1 3] -> Which leads to calling [‘B’, ‘A’, ‘C’] in downstream code
Whereas in older releases it was always: [1 2 3]
Questions:
Is this behavior change intentional in R2025b? I cannot find any documentation on that.
Is there a way to restore the old ascending-order behavior globally, for example via a preference or in startup.m?
Or is the only safe solution now to wrap every listdlg call with sort(idx) manually?
I can work around this with sort, but it would be very helpful if there were a default compatibility option, especially for larger existing codebases. listdlg, order, click, user MATLAB Answers — New Questions









