Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8033851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:49:49+00:00 2026-06-05T01:49:49+00:00

I have data in Matlab that is in cell array format with columns representing

  • 0

I have data in Matlab that is in cell array format with columns representing different items. The cell arrays have different columns, as in the following example:

a = {'A', 'B', 'C' ; 1, 1, 1; 2, 2, 2 }

a =

'A'    'B'    'C'
[1]    [1]    [1]
[2]    [2]    [2]

b = {'C', 'D'; 3, 3; 4, 4}

b =

'C'    'D'
[3]    [3]
[4]    [4]

I would like to be able to join the different cell arrays in the following manner:

c =

'A'    'B'    'C'    'D'
[1]    [1]    [1]    [NaN]
[2]    [2]    [2]    [NaN]
[NaN]  [NaN]  [3]    [3]
[NaN]  [NaN]  [4]    [4]

In the real example I have hundreds of columns and several rows, so creating a new cell array manually is not an option for me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:49:51+00:00Added an answer on June 5, 2026 at 1:49 am

    If you were willing to store your data in dataset arrays (or convert them to dataset arrays for this purpose), you could do the following:

    >> d1
    d1 = 
        A    B    C
        1    1    1
        2    2    2
    >> d2
    d2 = 
        C    D
        3    3
        4    4
    >> join(d1,d2,'Keys','C','type','outer','mergekeys',true)
    ans = 
        A      B      C    D  
          1      1    1    NaN
          2      2    2    NaN
        NaN    NaN    3      3
        NaN    NaN    4      4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array created in MATLAB that contains a number of cell type
I have some data generated in MATLAB that I want to process using Perl.
I have data that is organized in kind of a key-key format, rather than
I am writing a cell array of string into Excel from Matlab. I have
I have a data set file that has 3 columns in it. 0 0
I have some data that I would like to save to a MAT file
I have data that is of the following form: 'of' 45001 23366 21859591 52876216
I have a MATLAB function that needs access to the data of some largeFile.mat.
I'm working with a Matlab API that loads data from a proprietary format into
I have an N x N sparse matrix in Matlab, that has cell values

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.