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?

Help "index matrix not consistent"?

Asked by PRIYANGA

PRIYANGA

on 12 Dec 2012
Accepted Answer by Azzi Abdelmalek

Azzi Abdelmalek

I have to writhe matlab code for image compression.

i got the three values domr, domg, domb

domr=[6 7];

domg=[3 4];

domb=[1];

dom=cat(3,domr,domg,domb); ??? Error using ==>cat CAT arguments dimensions are not consistent.

Error in ==>

FVQLOWCOMPWMINCOLOR at 295

        dom=cat(1,domr,domg,domb); 
But I can't concatenate the values.I got the Error result " Cat argument not consistent" how can I concatenate that element? any body please help me?
PRIYANGA

PRIYANGA

2 Answers

Answer by Azzi Abdelmalek

Azzi Abdelmalek

on 12 Dec 2012
Edited by Azzi Abdelmalek

Azzi Abdelmalek

on 12 Dec 2012
Accepted answer
domr=[6 7];
domg=[3 4];
domb=[1];
dom=[domr,domg,domb]

%or

dom=cat(2,domr,domg,domb)

0 Comments

Azzi Abdelmalek

Azzi Abdelmalek

Answer by Muruganandham Subramanian

Muruganandham Subramanian

on 12 Dec 2012
Edited by Muruganandham Subramanian

Muruganandham Subramanian

on 12 Dec 2012

The problem is size(domr), size(domg) & size(domb) is not equal..

or

you can try like this:

dom=cat(1,domr(1),domg(1),domb(1));
dom=cat(1,domr(2),domg(2),domb(1));

1 Comment

PRIYANGA

PRIYANGA

on 13 Dec 2012

Thank you sir,

Muruganandham Subramanian

Muruganandham Subramanian

Contact us