필터 지우기
필터 지우기

How to output this cellarray?

조회 수: 2 (최근 30일)
Juan Rosado
Juan Rosado 2012년 12월 23일
I am trying to create an output for this cellarray but I'm kind of stuck.
The function goes like this,
function Time = Rin
fid = fopen( 'Rincon.txt' );
Time = textscan( fid, '%d%d%d%d%d%f%f%f%f%f%s%s%s%f%f' ...
, 'Delimiter' , ' ' ...
, 'CollectOutput' , true ...
, 'HeaderLines' , 2 ...
, 'MultipleDelimsAsOne' , true ...
, 'Whitespace' , '' ...
);
fclose( fid );
end
When you press run, it gives this output,
Time =
[2163x5 int32] [2163x5 double] {2163x3 cell} [2163x2 double]
I want to know how can I output the first cell of the array ( [2163x5 int32] ) in the Command window?
In other words, to be shown as it goes in the workspace.
I appreciate your time.

채택된 답변

Muruganandham Subramanian
Muruganandham Subramanian 2012년 12월 24일
  댓글 수: 3
Laura Proctor
Laura Proctor 2012년 12월 24일
Both Time{1,1} and Time{1} will give the same results. The difference is that row,column indexing is used in the first expression and the second expression uses linear indexing.
Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 24일
I know they give the same result, since Time dimension is nx1, why to use Time{1,1} instead Time{1}?

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

추가 답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 12월 23일

카테고리

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