필터 지우기
필터 지우기

How to extract labels from a xlsx graph in matlab

조회 수: 8 (최근 30일)
Amanda
Amanda 2022년 10월 30일
편집: Star Strider 2022년 10월 31일
I am trying to extract labels from a excel file. I can get it to give me the label for one data cell but when i try doing it for more then one it doesn't work. This is what i have so far but I dont know how to fix this problem

답변 (1개)

Star Strider
Star Strider 2022년 10월 30일
It depends how you’re importing the Excel file. If you use readtable, the header line (assuming only one) will be ‘VN’ in:
T1 = readtable('Your ExcelFile.xlsx', 'VariableNamingRule','preserve')
VN = T1.Properties.VariableNames;
If you’re using xlsread, it should be in the second output.
If you’re using readmatrix, all is lost, since the header lines will not be imported.
.
  댓글 수: 2
Amanda
Amanda 2022년 10월 30일
I am using xlsread
Star Strider
Star Strider 2022년 10월 31일
편집: Star Strider 2022년 10월 31일
The second output should be a cell array of non-numeric information. You need to request the second and third outputs specifically. By default, only the first output will result if you only ask for one output. (The third output is a cell array of all the information.) You will need to extract the labels from the second or third output.
EDIT — (31 Oct 2022 at 16:26)
If you post the Escel file, I might be able to help with this. I cannot do anything without it.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by