How to solve the error?

1 次查看(过去 30 天)
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 个评论
Rik
Rik 2018-3-25
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.

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2018-3-25
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 个评论
Darsana P M
Darsana P M 2018-3-25
Can I now combine them after making then as structures??
Image Analyst
Image Analyst 2018-3-26
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by