Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 matlab 的应用程序设计器中创建了应用程序并将其安装在应用程序中。我可以运行这个应用程序的一个或多个实例,但我只需要一个。例如在 matlab 的“GUIDE”中是选项:“GUI 只允许一个实例运行(单例)”
如果您检查 GUIDE 生成的代码,您会发现它使用全局应用程序数据来保持应用程序实例的计数。setappdata(0, ...)所以你可以用and实现类似的东西getappdata(0, ...)。
setappdata(0, ...)
getappdata(0, ...)