This paper introduces a parameter-free method for measuring the weighting functions of prospect theory and rank-dependent utility. These weighting functions capture risk attitudes, subjective beliefs, and ambiguity attitudes. Our method, called the midweight method, is based on a convenient way to obtain midpoints in the weighting function scale. It can be used both for risk (known probabilities) and for uncertainty (unknown probabilities). The resulting integrated treatment of risk and uncertainty is particularly useful for measuring ambiguity, i.e., the difference between uncertainty and risk. Compared to existing methods to measure weighting functions and attitudes toward uncertainty and ambiguity, our method is more efficient and can accommodate violations of expected utility under risk. An experiment demonstrates the tractability of our method, yielding plausible results such as ambiguity aversion for moderate and high likelihoods but ambiguity seeking for low likelihoods, as predicted by Ellsberg.