cellfun is useful for operations like this, where you want to do the same thing on each cell. Probably the best and most efficient code would look something like this:
Euler = readMessages(BagFile,startIdx:endIdx,"DataFormat","struct");
[yaw, pitch, roll] = cellfun(@getXYZFromPoint, Euler);
function [x, y, z] = getXYZFromPoint(msg)
If on the other hand you wanted to turn the cell array of messages (or message structs) into a message object or struct array, you could just do this:
Note that all messages have to have the same structure for that to work.