Unrecognized property 'Colormap' for class 'VideoWriter'??

7 views (last 30 days)
I'm trying to change some old code that used avifile(), to the new VideoWriter. Everything seems to work but one thing gives an error. According to the page https://www.mathworks.com/help/matlab/ref/videowriter.html , I should be able to use the a.Colormap variable to set a colormap, but my code gives this error:
Unrecognized property 'Colormap' for class 'VideoWriter'.
My code:
cmap = colormap(hsv(8));
aviobj=VideoWriter(filename)
aviobj.Quality=95
aviobj.Colormap=cmap
open(aviobj)
it never gets to the open() - it throws a error; what am I missing??
  1 Comment
Stephen23
Stephen23 on 22 May 2018
Edited: Stephen23 on 22 May 2018
@Michael Levin: please show the complete error message. This means all of the red text.
The documentation states that "The Colormap property only applies to objects used for writing indexed AVI files." Are you writing an indexed AVI file?

Sign in to comment.

Answers (2)

Walter Roberson
Walter Roberson on 22 May 2018
That functionality is new in R2017b.

Michael Levin
Michael Levin on 22 May 2018
Sorry, I don't understand. I'm using R2018a; the documentation shows this exact usage - why is it not working for me, and how do I specify the colormap for videos in 2018a?

Categories

Find more on Color and Styling 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!