Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.1.0 - English


coth

hyperbolic cotangent

Syntax

t = coth(x)

Arguments

x

vector or matrix of real or complex numbers (full or sparse-encoded).

t

a full-encoded vector or matrix of real or complex numbers.

Description

The elements of t are the hyperbolic cotangent of elements of x.

coth(0) not being 0, the result for any input sparse-encoded matrix is always full-encoded (as for cos()).

Examples

x = [1, 2*%i]
t = exp(x);
(t-ones(x)./t).\(t+ones(x)./t)
coth(x)
coth([-0 0])

// With sparses:
s = sparse([1 1; 3 1; 2 2; 2 3; 1 3],[0.02 0.7 0.15 0.4 3],[3 3])
coth(s)   // no longer sparse
--> (t-ones(x)./t).\(t+ones(x)./t)
 ans  =
   1.3130353   0.4576576i

--> coth(x)
 ans  =
   1.3130353   0.4576576i

--> coth([-0 0])
 ans  =
  -Inf   Inf

--> // With sparses:
--> s = sparse([1 1; 3 1; 2 2; 2 3; 1 3],[0.02 0.7 0.15 0.4 3],[3 3])
 s  =
(  3,  3) sparse matrix
(  1,  1)      0.02
(  1,  3)      3.
(  2,  2)      0.15
(  2,  3)      0.4
(  3,  1)      0.7

--> coth(s)   // no longer sparse
 ans  =
   50.006666   Inf         1.0049698
   Inf         6.7165918   2.6319324
   1.6546216   Inf         Inf

See also

History

VersionDescription
6.1.0 Extension to sparse matrices.
Report an issue
<< cotg Trigonometry csc >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon May 22 12:37:05 CEST 2023