Применить scatter3 к каждой ячейке массива с помощью cellfun - PullRequest
0 голосов
/ 20 февраля 2019

Как применить scatter3 к каждой {3x10} ячейке ycell?

numOfSensors = 10;
numOfSets = 7;

%% sample data preparation
x = 1:3;
y = rand(length(x), numOfSets*numOfSensors);
yCell = mat2cell(y, 3, numOfSensors*ones(1,numOfSets)); % this is my sensor data

ycell = {3x10}    {3x10}    {3x10}    {3x10}    {3x10}    {3x10}    {3x10}

Я преобразовал матрицу в массив ячеек.Как мне использовать scatter3 в каждой ячейке этого массива ячеек?

1 Ответ

0 голосов
/ 20 февраля 2019
hold on;   %To retain the points of all cellfun iterations
view(3);   %To set the default 3D view
cellfun(@(k) scatter3(k(1,:),k(2,:),k(3,:)), yCell);%Applying scatter3 to each cell of yCell

output

...