uint32 function example produces the "Index exceeds the number of array elements (1)" error

When running the Convert to 32-Bit Unsigned Integer Variable.mlx example in Matlab it produces the "Index exceeds the number of array elements (1)". It does not produce the Matworks resut. Why?

댓글 수: 3

dunno w/o seeing exactly what you did and error message in context...don't even know what example that would be.
dpb
dpb 2019년 5월 10일
편집: dpb 2019년 5월 10일
[Gilles Answer moved to comment--dpb]
Just type uint32 in R2019 Documentation Search
and read throug and execute example.
or here
Still dunno w/o seeing further details...works here.
Cut 'n paste commands to command line and I'll be extremely surprised if it doesn't work.
I've never used those pretty features; quite possible there's a typo in there or something I suppose.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 10일
When you execute a Live Script (.slx) then except for parts within a "function", it is a script like non-live scripts, which is to say that it executes within the context of the workspace of the caller ... inheriting whatever assignments have already been done.
So, the difficulty you are encountering is that in your base workspace, you have a variable named class or a variable named uint32 so when you execute the example code, referring to class(x) or uint32(x) would be a subscript request rather than a function call.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2019년 5월 9일

답변:

2019년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by