Why the user-defined function return an empty matrix when there is a division formula about global variables?
显示 更早的评论
Here is my code:
function ans = rho_free(xm)
global m ;%Where m = 1 is defined in the first few lines
ans = xm./m;
end
I've put this part of code at the end of the document, and defined
m = 1;
at the very begining of the same document.
When I call the function rho_free(2), I get an empty matrix. And I don't know why and have no idea how to solve this problem.
Thank
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 STL (STereoLithography) 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!