Error using table/writ​etable/wri​tecell

12 次查看(过去 30 天)
R
R 2022-2-4
回答: Simar 2024-1-4
When i try to create a table or write it/a cell to a file I get the following error
Error using writecell (line 165)
Invalid default value for property 'metaDim' in class 'table':
Too many output arguments.
I also get this error when copy/pasting the examples from the matlab website so it isnt a problem with my code.
  1 个评论
Walter Roberson
Walter Roberson 2022-2-5
I suggest experimenting with
restoredefaultpath; rehash toolboxcache
if that fixes the problem, then you have some .m file on your path that is interfering with internal MATLAB use of one of its functions.
Which MATLAB release are you using?

请先登录,再进行评论。

回答(1 个)

Simar
Simar 2024-1-4
Hi,
I understand that you are facing error while attempting to perform operations involving tables or cells in MATLAB.
The error message suggests that there might be an issue with MATLAB's internal functions or a conflict with custom scripts or functions in the MATLAB path. The error too many output arguments implies that a function is returning more outputs than expected, which could be due to an overload of a built-in function by a custom one with the same name, or a corrupted installation.
Here are some workarounds to diagnose and resolve the issue:
1. Check for Overloaded Functions:
Use the which command to check if there is an overloaded writecell or any other related function in the MATLAB path. For example:
which writecell -all
If the which command shows a file that is not within the MATLAB root directory, a custom function might be overshadowing the built-in one. Rename or remove the custom function to avoid conflicts.
2.Check for Name Conflicts:
Ensure to not have any variables with the same name as built-in functions. For example, if have a variable named writecell, it could cause conflicts.
3.Restore Default Path:
It is possible that the MATLAB path has been altered, leading to issues with function calls. Restore the default path by using the command:
restoredefaultpath;
rehash toolboxcache;
After restoring the default path, try running the code again.
4.Clear Workspace and Command Window:
Clear the workspace and Command Window to remove any residual variables or functions that may be causing issues:
clear all;
clc;
Try running the code again after clearing the workspace.
If issue persists, consider reaching out to MathWorks technical support for assistance. Remember to always back up before making significant changes to MATLAB installation or performing operations that might affect the code and data.
Please refer to the following documentation links:
Hope it helps!
Best Regards,
Simar

类别

Help CenterFile Exchange 中查找有关 Data Type Identification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by