记录一下自己最近遇到的问题

 

在matlab自定义函数(function)中怎么引入工作区变量(使用evalin函数)

x_inner = evalin(‘base’, ‘x’);

 

 evalin Evaluate expression in workspace.(evalin提取工作区中的变量)
 evalin(WS,'expression') evaluates 'expression' in the context of the workspace WS.  WS can be 'caller' or 'base'.  It is similar to EVAL except that you can control which workspace the expression is evaluated in.(工作区WS也称为‘caller’或‘base’)
 
 [X,Y,Z,...] = evalin(WS,'expression') returns output arguments from the expression.

 

 

eval函数的用法

参考:https://blog.csdn.net/sinat_32547403/article/details/53256463

 

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐