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

조회 수: 10 (최근 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 CenterFile Exchange에서 Workspace Variables and MAT Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by