existf.m
author A.M. Thurnherr <athurnherr@yahoo.com>
Thu, 21 Nov 2013 11:23:53 +0000
changeset 9 79a432124b57
parent 0 40938dd7a1f1
permissions -rw-r--r--
.
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