Problem with example code

So I've been trying to get to grips with MATLAB GUIs and looked at:
But when I try to run this code, I get the following errors:
Error using movegui (line 99)
unrecognized input argument
Error in simple_gui2 (line 52)
movegui(f,'center')
I can't see what's wrong with how movegui is being used.

 采纳的回答

Geoff Hayes
Geoff Hayes 2014-11-15

0 个投票

David - which version of MATLAB are you using?
The code that you are trying to use (from the given link) was developed with MATLAB R2014b. If I try to run the same code on R2014a, I see the same error as you. This is because of how handles to figures are now managed in R2014b. Rather than being a graphics handle (resembling a double like 172.343434) it appears to be more like a structure/object with properties.
If you want to find something similar for your version of MATLAB, then go to archived MATLAB documentation, choose the appropriate version, and search for whatever it is you are interested in. For example, a similar simple GUI for R2014a can be found at R2014a - creating a simple programmatic GUI .

1 个评论

I am using R2013a and just looked up the documentation for this version which is giving me code that works. Thanks!

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 App Building 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by