How do I use the values in a .txt file to create a stacked bar graph?

2 visualizaciones (últimos 30 días)
Golnar
Golnar el 26 de Mzo. de 2014
Comentada: Dishant Arora el 27 de Mzo. de 2014
I've already been successful at opening the file and obtaining the values
fileID = fopen('report_data.txt','r');
patientName=fgetl(fileID);
dateOfBirth=fgetl(fileID);
notes=fgetl(fileID);
healthy_exposed = fgetl(fileID);
pus = fgetl(fileID);
necrotic = fgetl(fileID);
ulcer_stage = fgetl(fileID);
area = fgetl(fileID);
volume = fgetl(fileID);
fclose(fileID);
But I'd like to take healthy_exposed, pus, and necrotic and create a stacked bar graph.

Respuestas (1)

Dishant Arora
Dishant Arora el 26 de Mzo. de 2014
Editada: Dishant Arora el 27 de Mzo. de 2014
bar( [str2num(healthy_exposed)', str2num(pus)', str2num(necrotic)'], 'stacked')
  4 comentarios
Golnar
Golnar el 26 de Mzo. de 2014
Hey Dishant, I did recently use str2num actually.
figure;
bar(cat(1, str2num(healthy_exposed), str2num(pus), str2num(necrotic)), 'stacked');
The result is this. It failed to produce a 'stacked' bar graph.
Dishant Arora
Dishant Arora el 27 de Mzo. de 2014
I was wrong on my part. I have made appropriate changes in the answer.

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by