How can I create a MATLAB function for importing data from an Excel table?

  • Context: MATLAB 
  • Thread starter Thread starter Tina22
  • Start date Start date
  • Tags Tags
    Function Matlab
Click For Summary

Discussion Overview

The discussion revolves around creating a MATLAB function to import data from an Excel table, specifically focusing on the structure of the data, including a header and waveform characteristics. The conversation includes technical details about the data format and organization within the Excel file.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks assistance in defining a header (34x1 array), waveform characteristics (34x88 array), and waveform data (10001x88 array) in MATLAB.
  • Another participant requests clarification on the intended structure of the header, questioning the feasibility of using a 34x1 character array for multiple features.
  • The original poster clarifies that the header consists of characteristics like rise time and fall time, and that it is organized as the first vertical column in the table without any headers above the columns.
  • There is a suggestion to use Excel directly and let MATLAB read the data instead of creating a function.
  • The original poster insists on the necessity of implementing the function as described, rejecting the alternative of using Excel directly.

Areas of Agreement / Disagreement

Participants have differing views on the best approach to handle the data import, with no consensus reached on the necessity of creating a MATLAB function versus using Excel directly.

Tina22
Messages
5
Reaction score
0
Hi all,

I am trying to create a function in MATLAB for a table in Excel. Basically, I have to define a header (an array 34*1), waveform characteristics (that is an array 34*88), and finally data for the waveforms (that is a array 10001*88). Could you please help me on that??

Thanks
 
Physics news on Phys.org
You really need to give more details. Questions:

1)

What do you want in the header (34x1 array)?

a 34x1 array of characters will only hold 34 characters, so if you have 34 features to describe wave characteristics, you'll only be able to use one letter for each feature.

2)

I'm assuming these are meant to be two different tables (one with a text header above each column). Do they go on the same, separated by blank cells, or do they go on another sheet? Or am I totally misunderstanding your goal here?
 
You are right. I would have explained more. Sorry about that.

1) I would like to have some characteristics in the header like rise time, fall time,etc. Isn't it possible?

2) Basically, There are not two different tables. Let me explain more. Header is not above each column, it is the first vertical column in the table, that's why I define the array like 34*1.

There should not be anything above each column. I have the data right in front of the header and that's all for the top part of the table.

For the bottom part (waveforms data), it starts exactly after the top part finishes (no blank cell between). That's why the array (10001*88) for that has the same columns like the waveform char data (34*88).

I am trying to write MATLAB codes for that (basically a function) to easily access the data, instead of using Excel.

Your help is greatly appreciated.
 
why don't you use excel and let MATLAB read it?
 
because I have to do it in the way I explained above.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K