필터 지우기
필터 지우기

Potential subjects for an experiment that are stored in a vector:

조회 수: 1 (최근 30일)
Nora
Nora 2013년 10월 20일
>> subjects subjects = 1x3 struct array with fields: name sub_id height weight >> subjects(1) ans = name: 'Joey' sub_id: 111 height: 6.7000 weight: 222.2000
As an example, you can create the following vector of subjects in your command window: subjects(4) = struct('name','Mary','sub_id',363,'height',5.1,'weight',110); subjects(1) = struct('name','Joey','sub_id',111,'height',6.7,'weight',222.2); subjects(2) = struct('name','Pat','sub_id',221,'height',5.9,'weight',165); subjects(3) = struct('name','John','sub_id',201,'height',5.2,'weight',155);
For this particular experiment, the only subjects who are eligible are those whose height or weight is lower than the average height or weight of all subjects. Write a function that takes this vector as input argument. The function will examine all records and print the names of those who are eligible. Don’t assume that the length of the vector is known; the code should be general.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by