How to solve the error?

1 Ansicht (letzte 30 Tage)
Darsana P M
Darsana P M am 25 Mär. 2018
Kommentiert: Image Analyst am 26 Mär. 2018
iop=cat(4,CIPH,TAGG'); I got this error:
Error using cat
Dimensions of matrices being concatenated are not consistent.
Error in encryyyy (line 239)
iop=cat(4,CIPH,TAGG');
I would like to combine: CIPH and TAG
whos TAG
Name Size Bytes Class Attributes
TAG 16x2 64 char
>> whos CIPH
Name Size Bytes Class Attributes
CIPH 4-D 7296 cell
How to solve this?
I am working on cryptography, AES-GCM algorithm. As output, I get cipher text and tag. I want to combine them at output. I found this operation 'cat to combine texts. What is the other alternative to do this?
  1 Kommentar
Rik
Rik am 25 Mär. 2018
What you want is not possible. How should Matlab concatenate two variables of totally different dimensions and even different file types?
The question is why you want to do this. Maybe we can help you solve that problem.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 25 Mär. 2018
Depends on what you want. You could assign it to a field in a structure. You could write them to a character array. You could put them into cells of a cell array. You could write the variables to a .mat file, etc.
  10 Kommentare
Darsana P M
Darsana P M am 25 Mär. 2018
Can I now combine them after making then as structures??
Image Analyst
Image Analyst am 26 Mär. 2018
I'm not sure how you want to combine then. You can combine different structures, but you can't combine two totally different things. Let's say the 4-D things is a video, in other words a series of multiple 3-D images. They are 3-D because they are color, and 4D because at each point in time we have a new/different RGB image. Now let's say you have a gray scale 2-D image and you want to "combine it". Well how? Do you want to add it as a frame to the end of the video? You can't, unless you turn it into a 3-D array, like an RGB image. If you do THAT you can do it, but otherwise you can't. It's basically the same for your situation. You can't combine a 2-D array with a 4-D array directly. You need to do something to allow the concatenation/combination, but you have not said HOW. You can't just do it without saying how to do it.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by