matlab.net.http.HeaderField.eq - Compare two HeaderField arrays - MATLAB (original) (raw)

Main Content

Class: matlab.net.http.HeaderField
Namespace: matlab.net.http

Compare two HeaderField arrays

Syntax

Description

[field1](#ref%5Fq3fxxcmmc9-field1) == [field2](#ref%5Fq3fxxcmmc9-field2) compares two HeaderField arrays element by element, returning an array of logical values indicating matching elements. The arrays must have the same dimensions, unless one is a scalar.

Two header fields are equal if they are functionally equivalent, even if they are not identical. Functionally equivalent means both of these conditions are true:

The == method compares the Name and Value properties only. The method ignores the actual classes of field1 and field2, since both are instances of the HeaderField class.

example

tf = eq([field1](#ref%5Fq3fxxcmmc9-field1),[field2](#ref%5Fq3fxxcmmc9-field2)) is an alternative way to executefield1 ==field2. The method returns a logical scalar or array.

Input Arguments

Examples

expand all

This comparison evaluates to true, even though one object being compared is a HeaderField object and the other is a DateField object.

import matlab.net.http.HeaderField import matlab.net.http.field.DateField dt = datetime('now'); HeaderField('Date',dt) == DateField(dt)

Version History

Introduced in R2016b