0

How to apply scatter3 on each {3x10} cell of 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}

I have converted the matrix to a cell array. How do I use scatter3 on each cell of this cell array?

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58
P. Bika
  • 1
  • 1

1 Answers1

0
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

Sardar Usama
  • 19,536
  • 9
  • 36
  • 58