how to import excel data into matlab

2

I want to import excel data into matlab, I've already tried importdata, but there are some things that do not fit right. I get "NaN" instead of numbers in the array

    
asked by anonymous 01.06.2015 / 23:33

2 answers

4

Have you tried using xlsread?

xlsread(nome do arquivo,pasta,intervalo)

Example:

% Criar um arquivo do excel chamado Exemplo.xlsx.

values = {1, 2, 3 ; 4, 5, 'x' ; 7, 8, 9};
headers = {'primeiro','segundo','terceiro'};
xlswrite('Exemplo.xlsx',[headers; values]);

% Pasta tem então os dados (Exemplo.xlsx):

   primeiro    Segundo    Terceiro
       1         2        3
       4         5        x    
       7         8        9

%Ler os dados numéricos da primeira pasta do arquivo:

filename = 'Exemplo.xlsx';
A = xlsread(filename)
A =
     1     2     3
     4     5   NaN
     7     8     9

For more information, visit link

    
02.06.2015 / 04:51
0

Export by excel in csv format, can be separated by comma or space

The read process only needs to use csvread(filename)

Usage example: arq = csvread(arqExcel.csv)

Source: link

    
03.11.2018 / 00:17