num2str {matlab2r}R Documentation

Numeric to string

Description

Converts a numeric value to character. This is essentially a wrapper over base::as.character().

Usage

num2str(A, format)

## S4 method for signature 'numeric,missing'
num2str(A)

## S4 method for signature 'array,missing'
num2str(A)

## S4 method for signature 'numeric,numeric'
num2str(A, format)

## S4 method for signature 'array,numeric'
num2str(A, format)

## S4 method for signature 'numeric,character'
num2str(A, format)

## S4 method for signature 'array,character'
num2str(A, format)

Arguments

A

numeric object

format

either a number or a string (see fmt argument of base::sprintf()).

Value

A, with its format possibly reshaped by format

Methods (by class)

Author(s)

Waldir Leoncio

Examples

X <- rnorm(10)
num2str(X)
num2str(X, 2)
A <- matrix(runif(4), 2)
num2str(A)
num2str(A, 3)
num2str(pi * 10, "%e")

[Package matlab2r version 1.5.0 Index]