Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

isscalar

Determine whether input is scalar

Syntax

isscalar(A)

Description

isscalar(A) returns logical 1 (true) if size(A) returns [1 1], and logical 0 (false) otherwise.

Examples

collapse all

A = [1 2; 3 4];
isscalar(A)
ans = logical
   0

B = A(1,1);
isscalar(B)
ans = logical
   1

Extended Capabilities

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

Introduced before R2006a

Was this topic helpful?