Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Reading jpeg image sequence from current directory.

Asked by Swapna Tekale

Swapna Tekale (view profile)

on 10 Jul 2014
Latest activity Edited by William beason

William beason (view profile)

on 22 Sep 2014

Hi, I want to read JPEG images from current directory. Images are named sequentially like IM1, IM2 and so on of same size i.e 384 by 256. I wrote following code. It is giving error-- Assignment has more non singleton rhs dimensions than non- singleton subscripts.

    fileFolder = fullfile(matlabroot,'toolbox','images',imdemos', 'img');
    dirout = dir(fullfile(fileFolder,'*.jpeg'));
    fileNames = numel(fileNames);
    I = imread(fileNames{1});
    sequence = zeros([size(I) numFrames],class(I));
    sequence(:,:,1) = I;
    for p = 2:numFrames
        sequence(:,:,p) = imread(fileNames{p});
    end

0 Comments

Swapna Tekale

Swapna Tekale (view profile)

Products

No products are associated with this question.

3 Answers

Answer by William beason

William beason (view profile)

on 10 Jul 2014
Edited by William beason

William beason (view profile)

on 22 Sep 2014
Accepted answer

You should check this link here http://outsourcingtax.weebly.com/ to know more briefly about the debugging and image related coding. I am sure it will helpful for you.

1 Comment

Swapna Tekale

Swapna Tekale (view profile)

on 12 Jul 2014

Thank you my code worked.

William beason

William beason (view profile)

Answer by per isakson

per isakson (view profile)

on 10 Jul 2014

Here are some links on debugging in Matlab

BTW:

    fileNames = numel(fileNames);

will assign a double scalar to fileNames

1 Comment

Swapna Tekale

Swapna Tekale (view profile)

on 10 Jul 2014

Thank you for answering my question. Can you please specify what exactly I have to change.

per isakson

per isakson (view profile)

Answer by Swapna Tekale

Swapna Tekale (view profile)

on 10 Jul 2014

Thank you for answering my question. Can you please specify what exactly I have to change.

0 Comments

Swapna Tekale

Swapna Tekale (view profile)

Contact us