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