have you ever been in a situation where you're trying to build a project but are
still waiting on sensors that haven't even left the warehouse yet well did you
know you could use your smartphone for those tasks your smartphone is home to
several sensors and with the MATLAB mobile app you can use some of those
sensors to collect and analyze data as a simple example in this video I'm going
to show you how to acquire an image to the corniche processing and acquire
position data to calculate some distance travel the MATLAB mobile app can be
downloaded directly from the Apple App Store or the Google Play Store for free
let's switch over to the MATLAB mobile app on the iPhone you can access the
camera to take an image or video either programmatically or manually I'm going
to show you how to take an image manually and then use that image
programmatically later in the video to access the camera just click on the file
section in the left menu and click the plus sign at the top right corner as you
can see I'm standing outside the map of headquarters on a cloudy afternoon using
the camera on the MATLAB mobile app is easy and intuitive just like you would
in most of their applications now that I've taken the image it's being uploaded
of MATLAB Drive which is where I will sync all my files and my data the image
was uploaded as a JPEG with the name that was auto-generated since I'm going
to be using this image I needed to be something meaningful let's rename it to
be test IMG okay let's go back to the command window and actually start
writing some code let's see what the image looks like I'm going to use I am
read which is an invert MATLAB function and then news I am sure to actually see
the image
you
now that we've taken the image your next obvious question would be well what can
I do with this well you can write your own scripts or you can use canva and
have functions to do your analysis I'm going to be using the environment lab
edge detection function to find edges in this image first I'm going to convert
the RGB image to grayscale and then use the edge function to get the edges in
this image and voila it was very easy to use my phone to acquire animation and
perform some quick image processing now if you want you can convert all the
commands into a script so you can use it anytime whether it's on your phone or
your desktop or laptop the technology that makes this possible is MATLAB Drive
which is where you're syncing all your files and your data this is going to be
helpful later in the video all right as I promised let's see what
other sensors you can use with the MATLAB on the Left you can access the
other sensors using the sensor menu within the app you can log data from all
available sensors or just one sensor depending upon what you're trying to
achieve there are two methods to collect data you can either log data and save it
as a mat file or stream data to MATLAB in today's video we're going to learn
how to log the data and access it collected enough to calculate distance
traveled we're going to collect latitudinal and longitudinal information
there is actually a very nice walking path around the mat books campus which
is 0.25 miles and we're going to use as as a comparison when you stop logging in
data you can save it as a mat file and specify the file name as I mentioned
earlier MATLAB Drive enables you to use this data either from your smartphone or
your laptop since this data is being stored on MATLAB Drive actual you want
to use it on my laptop so let's switch context here you can see my laptop and
let's see what the data looks like since the data is being stored in MATLAB Drive
you can access it from your laptop or your desktop all right now let's use the
Harrison formula to calculate total distance travel the distance calculated
is approximately zero point two seven miles which is close to the physical
distance that I mentioned earlier now you can imagine using this
same analysis on a different data set especially when you don't have access to
your laptop since I used a script to run this analysis I can reuse the script on
my phone in this case with same data to see what I get and here you see I get
the same result all right let's step back and do
something purely fun you've probably seen geo-tagging filters on snapchat
alright so we're going to do something similar we're going to use the latitude
and longitude noir information that we collected our data set previously and
put it on top of the image that we took earlier let's recap what we learned we
learned how to acquire an image do some image processing we also learn how to
acquire position data and perform some analysis on it if you would like to
learn more about MATLAB mobile the different sensors that you have access
to or other concepts discuss in this video then check the links in the
description below we are excited to learn how you are going to use math arm
over comment below