Azzera filtri
Azzera filtri

Cannot set camera position because of negative integers

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

Walter Roberson
Walter Roberson il 30 Gen 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 Commenti
Walter Roberson
Walter Roberson il 31 Gen 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 il 31 Gen 2021
That is good to know :D I did not realize this

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su MATLAB Support Package for IP Cameras in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by