Cannot load "map".

5 次查看(过去 30 天)
Fred
Fred 2022-10-24
移动Walter Roberson 2022-11-3
I am very, very new to coding. Am trying to use the 'map' function of MATLAB and I get the attached error message.
map
Error using uimenu
Unrecognized property call for class Menu.
Error in map (line 149)
menurot1 = uimenu(menug,'label','Default',...
Index exceeds the number of array elements. Index must not exceed 0.
Error in map (line 255)
flag = get(sh(3),'user');
Error while evaluating UIControl Callback.
I have no idea what to do. If you can help, please keep it as simple as possible. Thank you!
  3 个评论
Fred
Fred 2022-11-3
移动:Walter Roberson 2022-11-3
Hi Sudarshen,
Thanks for your offer to help. But..........
For the forseeable future, I will not be working with MATLAB. This is just a hobby for me and family matters require my attention elsware for a while.
Until then,
Peace!
Walter Roberson
Walter Roberson 2022-11-3
The user code had a number of places where it created a vector that mixed graphics handles and double precision numbers in the same vector, and then used constant numeric offsets to pick out the desired portion. At least two different such vectors were used. Mixing handles and floating point values was possible in HG1 as HG1's user interface to graphics handles was as floating point numbers.
My adjusted version changed one of the two vector formats into a struct with named fields and appropriate relative offsets. But that was a non-trivial amount of work, and I did not go through and do the same thing for the other vector format.
The code as it now stands has the problem that it tries to use the UserData field of an uninitialized graphics handle. It is basically a logic error in the original code, which initializes the second member of a pair of handles but not the first member of the pair but expects to be able to reference the first member anyhow. Really that part could use some debugging to figure out what the intent there was to fix it properly. The short-cut would be to initialize the first member of the pair to groot to give it a place to access the UserData.... I think that is why the code functioned at all in HG1, that the uninitialized handle would have been 0 which would have corresponded to the HG1 graphics root...

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Properties 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by