Error using table/writetable/writecell
조회 수: 13 (최근 30일)
이전 댓글 표시
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
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
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:
- https://in.mathworks.com/help/matlab/ref/which.html?searchHighlight=which&s_tid=srchtitle_support_results_1_which
- https://in.mathworks.com/help/matlab/ref/restoredefaultpath.html?searchHighlight=restoredefaultpath&s_tid=srchtitle_support_results_1_restoredefaultpath
- https://in.mathworks.com/help/matlab/ref/rehash.html?searchHighlight=rehash%20toolboxcache&s_tid=srchtitle_support_results_1_rehash%20toolboxcache
- https://in.mathworks.com/help/matlab/ref/clear.html?searchHighlight=clear%20all&s_tid=srchtitle_support_results_1_clear%20all
- https://in.mathworks.com/help/matlab/ref/clc.html?searchHighlight=clc&s_tid=srchtitle_support_results_1_clc
Hope it helps!
Best Regards,
Simar
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!