Cannot set camera position because of negative integers

1 visualización (últimos 30 días)
link
link el 30 de En. de 2021
Comentada: link el 31 de En. de 2021
So I want to set the camera position depending on a 3d point in the figure. If I print the current camera position to the console, I get the following output
campos =
279.5283
-101.4030
-740.6563
If I want to set the camera position
cpos =
347.2583
-96.3936
-711.3793
campos(cpos');
I get the error 'Array indices must be positive integers or logical values.'
I don't understand what I am doing wrong, because the campos cleary also has negative values.

Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de En. de 2021
campos =
279.5283
-101.4030
-740.6563
That tells us that you assigned something to a variable named campos
campos(cpos');
and now you are trying to use campos as a function. But it is not a function, it is a variable because you assigned to it.
  3 comentarios
Walter Roberson
Walter Roberson el 31 de En. de 2021
Notice your output had "compos =" at the beginning of it. If you had been calling the campos() function, then the result would have started "ans =" . MATLAB only displays "NAME =" when there is a variable with the given name that is being displayed.
link
link el 31 de En. de 2021
That is good to know :D I did not realize this

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Support Package for IP Cameras en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by