Filter löschen
Filter löschen

Cannot set camera position because of negative integers

1 Ansicht (letzte 30 Tage)
link
link am 30 Jan. 2021
Kommentiert: link am 31 Jan. 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.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 30 Jan. 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 Kommentare
Walter Roberson
Walter Roberson am 31 Jan. 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 am 31 Jan. 2021
That is good to know :D I did not realize this

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB Support Package for IP Cameras finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by