length error don't know why
3 次查看(过去 30 天)
显示 更早的评论
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1633526/image.jpeg)
2 个评论
Steven Lord
2024-3-3
Please show us the full and exact text of the warning and/or error messages (all the text displayed in orange and/or red in the Command Window.) That exact text may help us more easily determine the root cause of the error and be able to suggest a workaround or solution.
采纳的回答
Walter Roberson
2024-3-3
The error is not due to length(). The error is due to having run EDwithNetwork() without providing enough parameters
In particular, you would get that error if you pressed the green Run button to execute EDwithNetwork.
MATLAB never goes looking in the environment for variables that are named in the function() definition.
You should create some code that assigns values to variables that will be used by EDwithNetwork(), and then call the function passing in the appropriate values.
0 个评论
更多回答(1 个)
Sulaymon Eshkabilov
2024-3-3
Check this in the command window:
which length
If by mistake any variable or M-file was called by length, the variable can be removed with:
clearvars length
If a mistkaenly named M-file exists, then it should be deleted.
1 个评论
Stephen23
2024-3-3
The CVX toolbox defines its own LENGTH function/method. I would not recommend deleting it.
另请参阅
类别
在 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!