Hi,
I understand that you are encountering an error while trying to set the variable name of “Table” to match the “EditField” value. This happens because “app.EditField.Value” may be empty or contain spaces, special characters, or numbers at the beginning, making it an “invalid structure field name”.
In MATLAB, Field names, like variable names, must begin with a letter, can contain letters, digits, or underscore characters, and are case sensitive.
To fix this, you can modify the field name to make sure it is valid. You can also use “matlab.lang.makeValidName” function which converts it to a valid name by replacing invalid characters with underscores and ensuring it does not start with a number.
newName = matlab.lang.makeValidName(strtrim(app.EditField.Value));
For more information about Generating field names from Variables, please refer to the following documentation:
Thanks!
