isequal

Compares x1,x2,... to each other; if all are equal, returns boolean value true, otherwise returns false.

Syntax

R = isequal(x1,x2,...)

Inputs

x
Any valid scalar | string | vector | matrix.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
Boolean value true or false.

Examples

Simple scalar input:

R = isequal(1,1,1,1,1)
R = isequal(1,1,4,2,1)
R = 1
R = 0

Complex number input:

R = isequal(2i-1,2i-1)
R = 1

Matrix input:

R = isequal([1,4,2;5,1,2],[1,4,2;5,1,2],[1,4,2;5,1,2])
R = 1

String input:

R = isequal('test','test','test')
R = 1