Help with cat command-URGENT HELP NEEDED

1 view (last 30 days)
Fawaz Amjad
Fawaz Amjad on 3 Mar 2018
Commented: Walter Roberson on 3 Mar 2018
Hi, So I am having trouble using cat command as it is not giving me the output I need. The variables are b1 ( 7351x8171 uint8) and same for b2 and b3. I am using C = cat(3,b1,b2,b3) since there are three variables so three dimensions and then after that the software is busy for really long time and runs the rows and columns of numbers without end. The main question is that I need to use cat command and the variables b1, b2 and b3 to create an RGB image and store it in the variable I_RGB. Please help me with this issue ASAP

Answers (1)

Walter Roberson
Walter Roberson on 3 Mar 2018
C = cat(3,b1,b2,b3);
That is, just put a semi-colon after the assignment to prevent the result from displaying to the screen.
You could also consider using
C = b1(:,:,[1 1 1]);
C(:,:,2) = b2;
C(:,:,3) = b3;

Tags

Community Treasure Hunt

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

Start Hunting!