How do I correspond locations in a nested structured array to locations inside of its nest?

1 回表示 (過去 30 日間)
For example:
patient.name = 'John Doe';
patient.dob = [042557];
patient.date = [040111; 022512];
patient.date.percentages=[ 02 08 09; 23 20 24]
patient.date.notes = ['Treated for diabetic wound ulcer'; 'Treated for obesity and diabetic wound ulcer'];
I want the first value in patient.date to correspond to the three values in patient.date.percentages, and the second value in patient.date to correspond to the next three values. And I want the first patient.date to correspond to the first string in patient.date.notes, etc? For the purpose of adding elements to the end of these arrays (and have them correspond correctly, to draw upon at a later date for patient data?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 2 月 27 日
patient.name = {'John Doe'};
patient.dob = {042557};
patient.date = {040111; 022512};
patient.percentages={ [02 08 09]; [23 20 24]}
patient.notes = {'Treated for diabetic wound ulcer'; 'Treated for obesity and diabetic wound ulcer'};
  1 件のコメント
Golnar
Golnar 2014 年 2 月 27 日
編集済み: Golnar 2014 年 2 月 27 日
Thank you.
If I have 3 values being outputted from a previous program, saved as variables: 1. exposed_healthy 2. pus 3. necrotic
And I want to add these three values into patient.percentages
And then create a stacked bar graph with the x-axis as the patient.dates and the y-axis as percentages, the stacks being the three values in percentages, is this how to do it?
patient(end+1).percentages=['healthy_exposed', 'pus', 'necrotic'];
figure; bar(1:12, [healthy pus necrotic], 0.5, 'stack');
axis([0 2 0 100]);
title('Chronology of Wound Specifications'); xlabel('Date of Visit'); ylabel('Percentage');
xdat = [040111 022412 [CURRENT DATE]];
legend('Healthy', 'Infection', 'Necrotic');

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBiological and Health Sciences についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by