transmit a Excel file in a vector or matrix

2 次查看(过去 30 天)
Hi,
i'm searching for information to transmit a Excel file in a vector or matrix.
Thanks

回答(1 个)

BN
BN 2020-1-21
编辑:BN 2020-1-21
I think you want to import an excel file into Matlab.
You can use xlsread if your excel format is .xls
myfile = xlsread('filename.xlsx') %or xls (it depends on format of your excel file)
or csvread if your excel file is .csv
myfile = csvread('filename.csv')
Alternatively, I recommend you to import your excel file using one of these commands:
myfile = readtable('filename.xlsx') %or filename.csv or filename.xls
you can read your excel file as a matrix:
A = readmatrix('filename.xlsx')
Or even read it as cell structure:
C = readcell('filename.xlsx')
once data is read into the workspace using any of the above-mentioned commands, you can do whatever you want.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by