Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Matlab dont read an excel column

2 ビュー (過去 30 日間)
Jorge Barrio Luna
Jorge Barrio Luna 2018 年 8 月 9 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi everyone, I want to read two specific columns as a matrix with Matlab from an Excel sheet. I want to read columns H and I of rows 1 to 1096. They have the following format these columns:
H I
112018 6,7064
212018 6,7721
etc etc
The problem is that it returns a 1096x1 matrix with only the values in column I. This is the code I am using:
THS=xlsread('HSV_0h_TUGW','H1:I1096')
I hope you can help me solve. A greeting.

回答 (1 件)

jonas
jonas 2018 年 8 月 9 日
編集済み: jonas 2018 年 8 月 9 日
xlsread has four outputs, because you cannot mix numbers and text in the same array. I am guessing that there is text in the second column, so you will find this data in the second output. In the third output you will find everything, but in an 'inconvenient' format.
[num,txt,raw,custom]=xlsread('HSV_0h_TUGW','H1:I1096')
You can also try using readtable instead. readtable outputs a table, where one column can be text and another one numbers.

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by