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 comentarios

dunno w/o seeing exactly what you did and error message in context...don't even know what example that would be.
dpb
dpb el 10 de Mayo de 2019
Editada: dpb el 10 de Mayo de 2019
[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.

Iniciar sesión para comentar.

 Respuesta aceptada

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.

Más respuestas (0)

Categorías

Productos

Versión

R2019a

Etiquetas

Preguntada:

el 9 de Mayo de 2019

Respondida:

el 10 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by