How to display data from a table using fprintf?

1 visualización (últimos 30 días)
Ahmed Tohamy
Ahmed Tohamy el 8 de Dic. de 2020
Comentada: Jon el 8 de Dic. de 2020
i'm trying to fprintf ('The Maximum Number of Cases Are: %d on %f', X) but i know im using the wrong code!! please HELP!

Respuestas (2)

Cris LaPierre
Cris LaPierre el 8 de Dic. de 2020
See the various ways to access data in a table here.
I think you want this
DATE = datetime(2020,06,19,"Format","MM/dd/yy");
DAILYCASES = 1774;
X=table(DATE,DAILYCASES)
X = 1x2 table
DATE DAILYCASES ________ __________ 06/19/20 1774
fprintf ('The Maximum Number of Cases Are: %d on %s', X.DAILYCASES,X.DATE)
The Maximum Number of Cases Are: 1774 on 06/19/20

Jon
Jon el 8 de Dic. de 2020
Editada: Jon el 8 de Dic. de 2020
fprintf ('The Maximum Number of Cases Are: %d on %f', X.DAILYCASES,X.DATE)
  2 comentarios
Jon
Jon el 8 de Dic. de 2020
you could also index directly into the original table
Jon
Jon el 8 de Dic. de 2020
I just noticed that Chris had already answered while I was editing my reply

Iniciar sesión para comentar.

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by