MATLAB: Do I get “1×4 cell” instead of a listing of the connected senors

connected sensorsev3properties

myev3 =
legoev3 with properties:
FirmwareVersion: 'V1.06X'
HardwareID: '00165347f098'
IPAddress: []
CommunicationType: 'Bluetooth'
BatteryLevel: 36
ConnectedSensors: {1x4 cell}

Best Answer

The return value from the command you used is a structure that contains a field that happens to be a 1 x 4 cell array.
The behavior for displaying a cell array depends the data type and size of the elements stored in the cells, and also depends on the width of the command window. The algorithm is not always perfect. For example, on the command window width I have right now,
>> pqrs.sa = {1,2,3, ones(1,65)}
pqrs =
struct with fields:
sa: {[1] [2] [3] [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]}
>> pqrs.sa = {1,2,3*ones(1,62), ones(1,65)}
pqrs =
struct with fields:
sa: {[1] [2] [3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3] [1×65 double]}
>> pqrs.sa = {1,2,3*ones(1,65), ones(1,65)}
pqrs =
struct with fields:
sa: {1×4 cell}
>> pqrs.sa = {1,2,3*ones(2,65), ones(1,65)}
pqrs =
struct with fields:
sa: {[1] [2] [2×65 double] [1×65 double]}
Generally speaking if the data is "too big to fit in the display" or "too complicated" then the cell array may be summarized just by giving its size.
To see all of the outputs at the same time, you can command,
celldisp(myev3.ConnectedSensors)