필터 지우기
필터 지우기

How to import different columns for example A, G, O or series of columns e.g. every 8 columns from excel

조회 수: 1 (최근 30일)
I am very new to Matlab and I am struggling to import different columns for example A, G, O or series of columns e.g. every 8 columns from excel into matlab. I have managed to create code that imports individual columns into cell arrays
[numbers, strings, raw] = xlsread('1.csv');
Excitation = raw(1:153,A); emission = raw(1,);
sample1 = raw(1:153,A);
sample2 = raw(1:153,B);
but I am then having issues trying to export the cell arrays back together into one worksheet in excel. Could someone point me in the right direction (sorry if this is an obviously basic step

채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 22일
combined = [sample1, sample2];
xlswrite('New_1.csv', combined);
  댓글 수: 2
Alun Owen
Alun Owen 2016년 1월 22일
Thank you Walter, I couldn't get "combine" to work but then realised I could use: horzcat = [sample1, sample2]; xlswrite('New_1.csv', horzcat); Thankyou for pointing me in the right direction.
Walter Roberson
Walter Roberson 2016년 1월 23일
"combined" is just a variable name here, not an option name. It should better than "horzcat" as "horzcat" is the name of an important MATLAB function. I notice you mention "combine" rather than "combined" which suggests you might have made a typing mistake.

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

추가 답변 (1개)

Chetan Rawal
Chetan Rawal 2016년 1월 22일
Hi Alun,
Since you are new, and using MATLAB with Excel, the following is the best place to learn and get your answer: http://www.mathworks.com/discovery/matlab-excel.html

카테고리

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