Cannot set camera position because of negative integers

1 次查看(过去 30 天)
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.

采纳的回答

Walter Roberson
Walter Roberson 2021-1-30
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 个评论
Walter Roberson
Walter Roberson 2021-1-31
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB Support Package for IP Cameras 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by