read string from excel file

조회 수: 14 (최근 30일)
Samer Husam
Samer Husam 2012년 5월 29일
댓글: Abdulmohsen Alfadhli 2019년 9월 28일
Hi, I want to read text saved in Data sheet and display it on static text (GUI) . I am using this code but its not working:
Cell_Type=xlsread('G:\Data Sheet\Data sheet.xlsx','Sheet1','K4'); %where (K4) cell is wanted text
set(handles.text24,'string',Cell_Type);
what can I do to read it ?? please advice....

답변 (3개)

Walter Roberson
Walter Roberson 2012년 5월 29일
When you use xlsread() with only one output argument, the output is numeric. You need to use xlsread() with at least two output arguments and use the second one as the text string

GOPI
GOPI 2017년 1월 19일
I have some question - How to extract some rows from a Excel file by string matching?
Example: node_14] t=0.000640 START CCA CW = 2
node_20] t=0.000640 START CCA CW = 2
node_14] t=0.000768 CCA EXPIRES -----------> CHANNEL IDLE
node_20] t=0.000768 CCA EXPIRES -----------> CHANNEL IDLE
node_14] t=0.000960 START CCA CW = 1
node_20] t=0.000960 START CCA CW = 1
node_2] t=0.000960 START CCA CW = 2
node_16] t=0.000960 START CCA CW = 2
From this file I want to extract only the rows which started with node_14. Please suggest some tricks.
  댓글 수: 1
Abdulmohsen Alfadhli
Abdulmohsen Alfadhli 2019년 9월 28일
I have similar question, Please help if someone knows.

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


Samer Husam
Samer Husam 2012년 5월 30일
thanks MR. Walter, but how can i write it in matlab please ??
  댓글 수: 1
Walter Roberson
Walter Roberson 2015년 12월 5일
[~, txt] = xlsread('G:\Data Sheet\Data sheet.xlsx','Sheet1','K4'); %where (K4) cell is wanted text
Cell_Type = txt{1};
set(handles.text24,'string',Cell_Type);

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

카테고리

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