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

조회 수: 1 (최근 30일)
Manoj Kumar
Manoj Kumar 2014년 10월 29일
댓글: Yona 2014년 11월 3일
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
Adam
Adam 2014년 10월 29일
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 2014년 10월 29일
is a user defined funtion.
function Result = Count(data,condition)

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2014년 10월 29일
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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by