필터 지우기
필터 지우기

Extracting data from excel and rewrite it into specific cell in a loop

조회 수: 4 (최근 30일)
LIM JIAXIN
LIM JIAXIN 2018년 9월 24일
편집: LIM JIAXIN 2018년 10월 1일
Hello all, im new to matlab and wondering how do you extra the data from excel and rewrite it into specific cells format as shown below.
into this format below
  댓글 수: 2
Fangjun Jiang
Fangjun Jiang 2018년 9월 24일
No idea what is the relationship between these two sets of data.
LIM JIAXIN
LIM JIAXIN 2018년 9월 24일
Hi Jun Jiang, what i am trying to do is to move the column H into a column of cell M for example. So for example, H2 will move to M1, H1 to M2, M3 will be the number of A3:A7, H3:H7 to M4

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

답변 (1개)

Bob Thompson
Bob Thompson 2018년 9월 24일
The basic method for extracting data from Excel into Matlab is to use the xlsread() command. I would suggest reading all of the data you are interested in first, and then organizing the data within Matlab. At that point, moving the data is simply a matter of indexing and loops or condition statements.
  댓글 수: 3
Bob Thompson
Bob Thompson 2018년 9월 24일
Indexing is fairly simple. The super basics in two sentences is to use some form of brackets attached as a suffix to the array variable. Inside the brackets you need to have indicators for which element in which direction you want (i.e. first is row, second is column, then third dimension, fourth dimension, etc.).
data(1,3) % Element it first row, third column of array
data{1,3} % Element CONTENTS in first row, third column of cell array.
For your case you might be looking to do something like this:
rawdata = xlsread(filename,sheet,range);
data(2,1) = rawdata(2,8); % H2 to M1
LIM JIAXIN
LIM JIAXIN 2018년 9월 25일
I try reading from range A:H. and rewrite it into Sheet2. However the data come out is different from the original data as it just show 0 and 1.

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

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by