Borrar filtros
Borrar filtros

math operation

1 visualización (últimos 30 días)
sam arf
sam arf el 4 de Abr. de 2012
Hi, I have some problem here,
case1, a=7, b=4, a/b = 1.75
case2, a=3, b=2, a/b = 1.5
I want variable "c" to become decimal value of a/b,
c = 0.75 (for case 1), and c = 0.5 (case 2)
wich matlab operation should I use?

Respuesta aceptada

Jan
Jan el 4 de Abr. de 2012
a = 7;
b = 4;
c = rem(a / b, 1)
or
c = a / b;
d = c - floor(c);
  1 comentario
sam arf
sam arf el 6 de Abr. de 2012
thanks sir,

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing 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