Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

numsamples

Number of samples in neural network data

Syntax

numsamples(x)

Description

numsamples(x) takes neural network data x in matrix or cell array form, and returns the number of samples.

If x is a matrix, the result is the number of columns of x.

If x is a cell array, the result is the number of columns of the matrices in x.

Examples

This code calculates the number of samples represented by matrix data:

x = [1 2 3; 4 7 4]
n = numsamples(x)

This code calculates the number of samples represented by cell data:

x = {[1:3; 4:6] [7:9; 10:12]; [13:15] [16:18]}
n = numsamples(x)

Introduced in R2010b

Was this topic helpful?