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 9075977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:00:00+00:00 2026-06-16T19:00:00+00:00

I am having trouble importing data into an xlsx file from matlab. When I

  • 0

I am having trouble importing data into an xlsx file from matlab. When I write

sample = [1;2;3;4] <br/> <br/>
A = {'Title'; sample};

xlswrite(filename, A);

I get the the title showing up on excel but no column numbers below it. When I erase the curly braces and the string ‘Operating Point’ (i.e. A = sample) I do get a column of numbers 1,2,3,4. However it won’t let me put a title with the numbers below it. Can anyone help me figure out what I am doing wrong. I was going by an example I saw on the mathworks help page.

  • 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-16T19:00:02+00:00Added an answer on June 16, 2026 at 7:00 pm

    When you want to write both strings and numbers to Excel, you need to write a cell array. Importantly, each element of the cell array gets written to a single Excel cell. In your case, you’d be trying to write a vector into the second cell, which won’t work.

    Here’s what you want to do:

    sample = [1;2;3;4]
    
    %# transform sample to a cell array
    %# with one number per element
    sample = num2cell(sample); 
    
    %# create header
    header = {'Title'};
    
    A = [header;sample];
    
    xlswrite(filename, A);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble importing python packages only when running python from cmdline/console. However,
i'm importing someone's python project into rails and having some trouble getting galleria.js gallery
I'm having trouble thinking up a good way to implement a file importing class,
I am having trouble importing matplotlib into google app engine. I have googled around
I'm having trouble importing definitions from modules in Coq. I'm new to Coq, but
I'm having trouble splitting text in a data file such that suppose the the
I am having trouble importing an icon into my application. I have a main
Having trouble with an .htaccess file on WAMP. Works on the live server, but
I am having trouble importing my C++ functions. If I declare them as C
I'm trying to test out pyssh, but I'm having trouble importing it. I'm new

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.