existf.m
author A.M. Thurnherr <athurnherr@yahoo.com>
Fri, 04 Sep 2015 06:42:07 +0000
changeset 12 19bf03af3c6e
parent 0 40938dd7a1f1
permissions -rw-r--r--
DoMORE-2
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