Hướng dẫn dùng matlab arccos python

Inverse cosine in radians

Syntax

Description

example

Y = acos(X) returns the Inverse Cosine (cos-1) of the elements of X in radians. The function accepts both real and complex inputs.

  • For real values of X in the interval [-1, 1], acos(X) returns values in the interval [0, π].

  • For real values of X outside the interval [-1,1] and for complex values of X, acos(X) returns complex values.

Examples

collapse all

Inverse Cosine of Value

Find the inverse cosine of a value.

Inverse Cosine of Vector of Complex Values

Find the inverse cosine of the elements of vector x. The acos function acts on x element-wise.

x = [0.5i 1+3i -2.2+i];
y = acos(x)

y = 1×3 complex

   1.5708 - 0.4812i   1.2632 - 1.8642i   2.6799 - 1.5480i

Plot Inverse Cosine Function

Plot the inverse cosine function over the intervals -1≤x≤1.

x = -1:.01:1;
plot(x,acos(x))
grid on

Hướng dẫn dùng matlab arccos python

Input Arguments

collapse all

X — Cosine of angle scalar | vector | matrix | multidimensional array

Cosine of angle, specified as a scalar, vector, matrix, or multidimensional array. The acos operation is element-wise when X is nonscalar.

Data Types: single | double
Complex Number Support: Yes

More About

collapse all

Inverse Cosine

The inverse cosine is defined as

Extended Capabilities

Tall Arrays Calculate with arrays that have more rows than fit in memory.

This function fully supports tall arrays. For more information, see Tall Arrays.

C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

  • Generates an error during simulation and returns NaN in generated code when the input value X is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(X).

GPU Code Generation Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Usage notes and limitations:

  • Generates an error during simulation and returns NaN in generated code when the input value X is real, but the output should be complex. To get the complex result, make the input value complex by passing in complex(X).

Thread-Based Environment Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.

This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.

GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

Usage notes and limitations:

  • If the output of the function running on the GPU can be complex, then you must explicitly specify its input arguments as complex. For more information, see Work with Complex Numbers on a GPU (Parallel Computing Toolbox).

For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Distributed Arrays Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.

This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).

Version History

Introduced in R2006a