acceleration function not working in script?

2 views (last 30 days)
Hello, i'm trying to assign the value returned from the acceleration function in the mobiledev object
In the m variable I can see the acceleration values but when I call the acceleration function and assign its output to the variable 'x' nothing is in it.
When I run m.acceleration in the command window it works fine so why doesn't it work in this script?
Thanks

Answers (1)

Yongjian Feng
Yongjian Feng on 3 Jul 2021
In general, the debugger shall be able to show you the reason. Just run your Untitle2.m using the matlab debugger, and put a breakpoint in line 5. Then you can examine m directly.
  4 Comments
Will Isom
Will Isom on 4 Jul 2021
Im using a waitfor function which works , why do I need to use this in a script but yet in command window I can call the acceleration function and the values are returned with no problem?
Yongjian Feng
Yongjian Feng on 4 Jul 2021
Oh, a time delay? The command line window somehow is slower than the function call? Where do you put the waitfor function?

Sign in to comment.

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!