Spontaneously deleted information from struct variable
3 views (last 30 days)
Show older comments
Hi,
I have a wierd problam. I'm using Matlab 2023a, but it also happens in 2022 a&b, so I don't think it's related to the software version.
The thing is, I have a complex structure, which has 4 fields. The first field is a cell, but all the others are also structures so that a typical value can look like this:
Par.P(1).X = 721041
The thing is that while the variable is open on the variable window (so you can see the structure table with all the data), and one of the table cells is selected, sometimes Matlab decides spontaneously to delete the content of this cell. It is followed by the following statement in the Command window (for example):
Par.P(1).FR = [];
As far as I can tell, it only happens in these complex structures, not in any other types of variables or simple structures.
Has anyone know what might be the cause of this annoying problem?
Thanks!
Amit
6 Comments
Cris LaPierre
on 3 Apr 2023
Edited: Cris LaPierre
on 3 Apr 2023
When it happens, are there other variables in your workspace? Are you toggling back and forth between a script and the variable editor? Are there any actions you are performing that could be contributing? Has your session been running for a long time? Have you just finished running a script?
Just curious what state your MATLAB is in when this happens.
Answers (1)
Jack
on 3 Apr 2023
This sounds like a very strange issue that could potentially be caused by a bug in MATLAB. Here are a few suggestions that you could try to help troubleshoot and potentially solve the issue:
- Check if the issue persists in a new MATLAB session: Close MATLAB and reopen it to see if the issue still occurs. If the issue goes away in a new session, it could be a temporary problem that might have been caused by a specific operation or interaction with MATLAB.
- Check for any scripts or functions that might modify the structure: It's possible that there is a script or function that modifies the structure and could be inadvertently deleting the content of the cell. Search your codebase for any functions that modify the structure and see if any of them could be causing the issue.
- Check for any unintentional key presses: Sometimes, unintentional key presses can occur while typing or using the mouse. This could potentially cause the content of the cell to be deleted. Try to be mindful of any key presses that might occur while using MATLAB.
- Report the issue to MathWorks: If none of the above solutions work, you could consider reporting the issue to MathWorks support. They might be able to provide more insight into the issue or help you find a solution.
I hope one of these suggestions helps you solve the issue.
See Also
Categories
Find more on Environment and Settings 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!