Home > database > make_compqid.m

# make_compqid

## PURPOSE

Makes a vector of "composite question IDs" from given question IDs.

## SYNOPSIS

function compqid = make_compqid(qids,subqids, num_places);

## DESCRIPTION

``` Makes a vector of "composite question IDs" from given question IDs.

compqid = make_compqid(qids,subqids)

Makes a vector of "composite question IDs" from the vectors of question IDs
and subquestion numbers.

The format for the composite question ID is question.subquestion

num_places specifies how many places following the decimal point should be
used for representing the subquestion ID. When num_places=1, there is a limit
on 9 subquestions. For num_places=2 there is a limit of 99, etc.  Currently,
the Ensemble-wide assumption is that num_places = 2.```

## CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:

## SOURCE CODE

```0001 function compqid = make_compqid(qids,subqids, num_places);
0002 % Makes a vector of "composite question IDs" from given question IDs.
0003 %
0004 % compqid = make_compqid(qids,subqids)
0005 %
0006 % Makes a vector of "composite question IDs" from the vectors of question IDs
0007 % and subquestion numbers.
0008 %
0009 % The format for the composite question ID is question.subquestion
0010 %
0011 % num_places specifies how many places following the decimal point should be
0012 % used for representing the subquestion ID. When num_places=1, there is a limit
0013 % on 9 subquestions. For num_places=2 there is a limit of 99, etc.  Currently,
0014 % the Ensemble-wide assumption is that num_places = 2.
0015 %
0016
0017 % 01/28/07 Petr Janata
0018
0019 if nargin < 3
0020   num_places = 2;
0021 end
0022
0023 compqid = qids + subqids * 10^-num_places;
0024```

Generated on Wed 20-Mar-2019 04:00:51 by m2html © 2003