Indexing cell array column from excel data

조회 수: 2 (최근 30일)
Jocelyn Kenley
Jocelyn Kenley 2022년 6월 3일
댓글: Star Strider 2022년 6월 3일
Hey I am trying to make a array using data from excel. I already import the data , the problem is trying to get matlab recognize the colmuns. This is the code:
g=Experimental(:,B)
f=Experimental(:,C:E);
But when i run the code it doesn't recognize the g of the code. This is what I would get:
Unrecognized function or variable 'B'.
Error in l320w40_staticplot (line 13)
g=Experimental(:,B)
Please help!!

답변 (1개)

Star Strider
Star Strider 2022년 6월 3일
I do not have the matrices, however if they are already imported, use MATLAB indexing conventions to address them —
g=Experimental(:,2)
f=Experimental(:,3:5);
See the documentation on Matrix Indexing for details.
.
  댓글 수: 2
Jocelyn Kenley
Jocelyn Kenley 2022년 6월 3일
Thank you. It solved my problem
Star Strider
Star Strider 2022년 6월 3일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by