필터 지우기
필터 지우기

How to load excel columns under same variable file

조회 수: 2 (최근 30일)
Yellow Canary
Yellow Canary 2015년 9월 12일
댓글: the cyclist 2015년 9월 12일
I have an excel file it has 2 columns of data. When I import this file to Matlab, each column shown as a different file. (ex: VarName1 and VarName2) I want to show them under the same file. I want to plot them to Bar3 plot. When they are separate, I can't show them on the same plot. I want to plot a graph like this example http://www.mathworks.com/help/matlab/ref/bar3.html

채택된 답변

the cyclist
the cyclist 2015년 9월 12일
One possible solution is to just concatenate the two variables into one array:
VarName1 = rand(7,1);
VarName2 = rand(7,1);
figure
bar3([Varname1; Varname2])
  댓글 수: 2
Yellow Canary
Yellow Canary 2015년 9월 12일
That is what I was looking for. Thank you!
the cyclist
the cyclist 2015년 9월 12일
Clicking "Accept this Answer" is the best form of thanks (and may help guide future users with a similar question).

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

추가 답변 (1개)

the cyclist
the cyclist 2015년 9월 12일
If you use the Import Data tool (located in the Command Window), you can specify that you want to import into one variable, rather than separate columns. You can also have it generate code for you to do the import.

카테고리

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