Read data from hard disk

Hello, I use Matlab for Image analysis, so I use it for my video experiment. I have my videos on hard disk, so every time I woul like to put it to my Matlab code, I need to first move the video from hard disk to my computer, becouse directly from hard disk it is now working.
How I can do it, is there any special code for it?
Thank you so much.

5 Commenti

Jan
Jan il 1 Mar 2023
The question is not clear. Do you mean an external hard disk? What does "it is now (or "not"?) working" mean?
You cannot put a video into the Matlab code. Do you want to import the file data?
Yes the external hard disk.
It means, if is the video in my computer, my code can read it and make a results in 30 seconds. But if I am trying to read it from the hard disk, the code is running and running, but does not give me the results, Just running until I stop it.
Stephen23
Stephen23 il 1 Mar 2023
"How I can do it, is there any special code for it?"
Every MATLAB function that processes data files also accepts absolute/relative filenames. So you can simply define the absolute filenames (i.e. including the path to that external drive). Take a look at:
Your question is very vague on detail, but you could use something like
to get a list of all files on the externa drive, and then simply loop over them (using absolute filenames, of course).
Jan
Jan il 1 Mar 2023
@Eliska Paulikova: I guess, that the external disk is slow. Then processing a video frame by frame can take a lot of time. Copying the file with copyfile to the internal disk will take some time also, but this can be less stressing, because the data are moved in one block. But actually I assume, the total time for copying and processing is almost equal as for processing the file on the external disk.
You can use the debugger and profiler to find out, what happens inside the code and where the most time is spent.
Ok, thank you so much

Accedi per commentare.

Risposte (0)

Prodotti

Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by