필터 지우기
필터 지우기

get Data from Cell Arrays

조회 수: 1 (최근 30일)
Max Müller
Max Müller 2014년 7월 15일
댓글: Max Müller 2014년 7월 15일
Hey Guys,
This is only an example for the problem i have. A very Simple one, so i hope i get a fast answer.
Code:
a = 1:10;
b = 1:2:20;
c = a.*b;
D = {a;b;c}
D = [1x10 double]
[1x10 double]
[1x10 double]
Now if i want to get the 3rd Value of the 1st row ( a = 3) i type
D{1,3}
and it says
??? Index exceeds matrix dimensions.
I need it to be a Cell-Array, cause my actual code contains Numbers and String. How can i get the single Values/String form this Array ?
  댓글 수: 1
Max Müller
Max Müller 2014년 7월 15일
If u want to know my Problem. I have an Array called GetData.
GetData =
[1x41 double]
[1x41 double]
[1x41 double]
[1x41 double]
[1x41 double]
{1x41 cell }
Row 1-5 are Values, I want to plot. Row 6 contains a name.
Now I want to look in the 6th row at the 1st column and get the name.
But if i type GetData{6,1}, I get all 41 names.....

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 7월 15일
편집: Azzi Abdelmalek 2014년 7월 15일
D contains 3 cells, each cell contains an array
D{1}(3)
% {1} to get the first cell,
% (3) to get the third element of the array contained in the first cell
  댓글 수: 1
Max Müller
Max Müller 2014년 7월 15일
Azzi, Thanks a lot. Sorry for all these Questions. I am new to matlab.....i am just an intern with a big Project and his shoulders....

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by