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

  • Home
  • SEARCH
  • 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 9190859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:33:23+00:00 2026-06-17T20:33:23+00:00

How can I save this cell data = cell([3 2]); data{1,1} = ‘Bla’; data{2,1}

  • 0

How can I save this cell

    data = cell([3 2]);
    data{1,1} = 'Bla';
    data{2,1} = 'Bla1';
    data{3,1} = 'Bla2';
    data{1,2} = '2';
    data{2,2} = '3';
    data{3,2} = '1'

to a csv file?

I tried

dlmwrite('C:\Users\Ro\Desktop\Mestrado\Resultados\Tabelas\VaR_tab.csv',data,'delimiter',';')

but it give this error message:

Error using dlmwrite (line 118)
The input cell array cannot be converted to a matrix.
  • 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-17T20:33:24+00:00Added an answer on June 17, 2026 at 8:33 pm

    I just tried this, and it worked:

    filename = 'test';
    cell2csv(filename,data)
    

    with cell2csv available as

    function cell2csv(filename,cellArray,delimiter)
    % Writes cell array content into a *.csv file.
    % 
    % CELL2CSV(filename,cellArray,delimiter)
    %
    % filename      = Name of the file to save. [ i.e. 'text.csv' ]
    % cellarray    = Name of the Cell Array where the data is in
    % delimiter = seperating sign, normally:',' (default)
    %
    % by Sylvain Fiedler, KA, 2004
    % modified by Rob Kohr, Rutgers, 2005 - changed to english and fixed delimiter
    if nargin<3
        delimiter = ',';
    end
    
    datei = fopen(filename,'w');
    for z=1:size(cellArray,1)
        for s=1:size(cellArray,2)
    
            var = eval(['cellArray{z,s}']);
    
            if size(var,1) == 0
                var = '';
            end
    
            if isnumeric(var) == 1
                var = num2str(var);
            end
    
            fprintf(datei,var);
    
            if s ~= size(cellArray,2)
                fprintf(datei,[delimiter]);
            end
        end
        fprintf(datei,'\n');
    end
    fclose(datei);
    

    I copied the code cause I am not aware if the function is any longer available on MathWorks File Exchange. But Google should help too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to save output from this script to a file based on a cell
In my app, the user can save his input to disk. This is done
how can we save dragged item with cookies. I'm using Jquery with this code
I'm developing web app that user can save his/her work to server. The data
Is there a way that i can save data on each step in wizard
I want to setup a table that can: Save the data on the user's
I have a large csv file with approximately 170 columns' worth of numerical data
I have a JXTable where the users need to introduce data, then save it.
I am trying to create a .csv file with data that I have stored
I want to get and save data from a cell on event of UILongPressGestureRecognizer.

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.