それを行列に変換して直接プロットすることができます:
% Some dummy data - format a little different from your example
% to allow for different numbers of elements per row
A = {[0,0, 1,2, 3,4]; [0,0, 5,6]};
% Figure out how many columns we need in total
maxLen = max(cellfun(@length, A));
% Preallocate
Amat = NaN(size(A, 1), maxLen);
% Copy data
for n = 1:size(A, 1)
curA = A{n};
Amat(n, 1:length(curA)) = curA;
end
% Generate 1:N vector repeated the correct number of times (rows)
x = repmat(1:size(Amat, 2), size(Amat, 1), 1);
plot(x, Amat)
編集:投稿のある時点で 3D グラフについて言及しました。上記は 3D グラフをプロットしないため、次のようになります。
% Generate Amat as above
% Then:
[X, Y] = meshgrid(1:size(Amat, 1), 1:size(Amat, 2));
surf(X, Y, Amat.'); % OR: plot3(X, Y, Amat.');
これがまさにあなたが望むものかどうかはわかりませんが、あなたの質問は、これからどのような種類のグラフが必要かについて少し不明確です。プロットに色付きの線だけが必要な場合は、plot3
の代わりに使用できますsurf
が、IMHOsurf
はおそらくこの種のデータに対してより明確なプロットを提供します。