How can i use movefile properly?

1 view (last 30 days)
Robert Kurze
Robert Kurze on 27 Jan 2018
Commented: Robert Kurze on 27 Jan 2018
Hello there, i am currently trying to move a few images from A to B. Example: There are three images: a.jpg, b.jpg, c.jpg I want to move them from my current directory to 'F:\Programme\MATLAB\workspace_me\images203' I have an algorithm that does some other stuff with the images and that always works with the current image called 'image'.
movefile (image, 'F:\Programme\MATLAB\workspace_me\images203') does not work, because movefile needs a "Character vector".
So i get the name of my current image by calling: allJpegs(k).name, which returns in this example 'c.jpg'
Next try: movefile (allJpegs(k).name, 'F:\Programme\MATLAB\workspace_me\images203') That also does not work for the same reason.
Next try: movefile ('c.jpg', 'F:\Programme\MATLAB\workspace_me\images203') It works. But it makes me incomprehesibly aggressive that i have to type the exact name of my file in there. There must be a way to make that movefile function be useful in any way (i want to move thousands of files if they match certain criteria, so doing it by hand is no solution).
I also tried the following: str3 = string(allJpegs(k).name); movefile (str3, 'F:\Programme\MATLAB\workspace_me\Ziel'); But that ... again ... does not recognise my string.
Please help before i lose my mind completely. Thanks a lot, Robert
  1 Comment
Robert Kurze
Robert Kurze on 27 Jan 2018
Incredible. I removed the string() in the latest version and it works now. I really like making such mistakes for two or three hours and solving the problem right after complaining. fml.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!