Borrar filtros
Borrar filtros

how to get the variable in the place of a condition?

1 visualización (últimos 30 días)
Manoj Kumar
Manoj Kumar el 29 de Oct. de 2014
Comentada: Yona el 3 de Nov. de 2014
Hi,
I have a code as
dapicount1a = dapicount1 - Count(distanceDapi,'<10');
So, in the plalce of <10 I wish to enter a value with the help of variable "A".
I did like
dapicount1a = dapicount1 - Count(distanceDapi,'<A');
But I got error
"A" is the entered value using input dialog box.
Can you help me in solving this.
Thanks....
  2 comentarios
Adam
Adam el 29 de Oct. de 2014
What is Count? Is it from some toolbox or Simulink? In which case please put that in the Products box. Or is it your own defined function?
Manoj Kumar
Manoj Kumar el 29 de Oct. de 2014
is a user defined funtion.
function Result = Count(data,condition)

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 29 de Oct. de 2014
I have no idea what the ‘Count’ function is or does, but it apparently wants a string argument with a number.
See if this works:
A = 5;
sa = sprintf('<%d',A)
dapicount1a = dapicount1 - Count(distanceDapi,sa);

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown 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