Problems with global variables
5 次查看(过去 30 天)
显示 更早的评论
I'm willing to use the global function to define some constant parameters in a structure. The written codes are as following
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/170875/image.png)
But according to the error reminder the current use of 'Biofilm' is inconsistent with the previous use or Definition. I couldn't understand this hint and still couldn't find the error. Could anyone help me with that? Thanks a lot!
3 个评论
Jacob Bean
2019-4-11
Regardless of his level of understanding, people come here to ask questions. Not to be ridiculed.
Guillaume
2019-4-11
@Jacob, I'm not sure who your comment is addressed to. Nobody was being ridiculed in my post. There was a piece of advice and a genuine question that would have helped answering the OP question, had that question been answered.
回答(1 个)
Krishna Bindumadhavan
2018-3-13
You may have to remove Biofilm as the return argument, to make the function signature look like:
function setGlobalbiofilm()
As Biofilm is a global variable , it does not seem to be possible to declare it as a return value of a function. You can take a look at this documentation for further information.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!