Matlab Cell数组访问数据

时间:2018-04-17 17:39:55

标签: matlab

我正在尝试访问单元格数组中的第一个和最后一个数字。更具体地说,我需要第一个和最后一个X值来查看有多少位移。我正在导入一个跟踪文件,这就是为什么我在下面添加了trackmate脚本(希望它可能有所帮助)。

以下脚本是我使用的脚本;我在Mac上工作

addpath('/Applications/Fiji.app/scripts')

clipZ = true;
scaleT = true;
[tracks] = importTrackMateTracks('8Tracks.xml', clipZ, scaleT);
n_tracks = numel( tracks );

tracks{:,:,:};



% tracks = IMPORTTRACKMATETRACKS(file) opens the track file 'file' and
% returns the tracks in the variable 'tracks'. 'tracks' is a cell array,
% one cell per track. Each cell is made of 4xN double array, where N is the
% number of spots in the track. The double array is organized as follow: 
% [ Ti, Xi, Yi, Zi ; ...] where T is the index of the frame the spot has been
% detected in. T is always an integer. X, Y, Z are the spot spatial 
% coordinates in physical units.

1 个答案:

答案 0 :(得分:0)

我认为答案如下,它基于def rejsonify_df(df): if df.shape[0] == 0: return df cols_to_json = [c for c in df.columns if isinstance(df[c][0], dict) or isinstance(df[c][0], list)] df[cols_to_json] = [df[c].to_json() for c in cols_to_json] return df rejsonify_df(x).to_csv(index=False) 帮助段落,即使它看起来写得很糟糕(双列阵的维度也不一致):

IMPORTTRACKMATETRACKS

是你在寻找什么?