cst
cst

Reputation: 125

MATLAB importdata function

I have a text file with 5 columns and 73 rows, and I create this file from .xlsx format in excel. Now when I load this file with;

a = importdata('Input.txt')

this file is loaded in only 1 column instead of 5 columns, and the dimension of my variable a is equal to 73*1. I separate the input strings with tab and 8 spaces but nothing worked for me.

Please guide me, I am new with MATLAB. Thanks in advanced.

Upvotes: 0

Views: 259

Answers (1)

patrik
patrik

Reputation: 4558

You can try xlsread instead. That should work.

[NUM,TXT,RAW]=xlsread(FILE);

where RAW returns one cell per one xls cell, which is normally preferred in favor of NUM and TXT, which require proper matrices and does not plot columns that are improper.

Upvotes: 1

Related Questions