Pass variables from double to cell

1 Ansicht (letzte 30 Tage)
Maria
Maria am 24 Jun. 2014
Kommentiert: Maria am 24 Jun. 2014
I had a double variable A and I changed it to a cell-type variable B in the following way:
B = num2cell(A);
Then I built a new cell with different columns (all the other columns are from the cell-type):
ABC=[ B C D E F G];
and it gave me an error:
|Error using horzcat
Dimensions of matrices being concatenated are not consistent|
It is strange because I am working with cells all with the same number of rows. Can anyone help me? Thanks in advance for the help.

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 24 Jun. 2014
What you can do is
ABC={B C D E F G}
unless your variables have the same number of rows
  1 Kommentar
Maria
Maria am 24 Jun. 2014
I managed to solve the problem! I guess I was dealing with several types of cells coming from different variables. I did it similar to what you suggested. Thanks a lot!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Entering Commands finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by