Borrar filtros
Borrar filtros

Rational Numbers diving by 0

1 visualización (últimos 30 días)
Hello kity
Hello kity el 4 de En. de 2013
Hi
I show the result of each data ontop of a bar. I have it working. On top of each bar it shows of the rational of failure/measurements.
ratFailMeasurement=rats(Fail/Measurement);
if Fail is 0, then the answer is 0. this is what is shown on top of the bar. but I want that it shows 0/X-amountofmeasurements.
how to?

Respuesta aceptada

the cyclist
the cyclist el 4 de En. de 2013
Editada: the cyclist el 4 de En. de 2013
I think you will probably have to convert to a string manually, to display it how you'd like. For example:
[num2str(0),'/',num2str(7)]
You can of course put variable names where I have put hard-coded numbers. You can also use the sprintf() function to have more precise control over the output format.
  2 comentarios
Hello kity
Hello kity el 4 de En. de 2013
I think i ll do that first one. there are only a couple bars so wont make the code that longer. \
ty
Hello kity
Hello kity el 4 de En. de 2013
I got rid of the rat function and made all of them with strings :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks 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