
Last chance! 50% off unlimited learning
Sale ends in
Calculates the cosine of a number
# S3 method for modello_number
cos(x)
a reference object of class 'number'
Returns a reference object of class 'number'
# NOT RUN {
modello.init(10, 10, 10, 10)
## For sclars
x1 = number(pi, scalar=TRUE)
y1 = cos(x1)
print(y1)
print(y1$v)
## For arrays
x2 = number(matrix(pi, 3, 3))
y2 = cos(x2)
print(y2)
print(y2$v)
modello.close()
# }
Run the code above in your browser using DataLab