existf.m
author A.M. Thurnherr <athurnherr@yahoo.com>
Fri, 12 Jan 2018 17:39:32 -0500
changeset 13 82050b088a69
parent 0 40938dd7a1f1
permissions -rw-r--r--
V1.1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     1
function [yn,pos]=existf(d,n)
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     2
% function yn=existf(d,n)
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     3
% checks for existance of variable (n) in data field (d)
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     4
an=fieldnames(d);
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     5
pos=strcmp(an,n);
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     6
yn=sum(pos);
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     7
40938dd7a1f1 created with ANTS 4.0
A.M. Thurnherr <ant@ldeo.columbia.edu>
parents:
diff changeset
     8