Prev: Input data dependency violation due to action subsystems. See Subsystem Examples in the Simulink library for valid and invalid examples of action subsystems
Next: blockproc
From: Ben on 12 Apr 2010 20:33 I'm sure there must be a neat way to do this, but I can't see it. Can anyone help? I've got a cell array like this: {0.7,0.5,{0.6,0.8}} Or this: {0.8,{0.3,{0.9,0.9}},0.3} I want to multiply these cell arrays by an array of factors of the same length, where the factors are multiplied through any embedded cell arrays. It's kind of like multiplying through the brackets in a formula. So for example I'd like it to work like this: {0.7,0.5,{0.6,0.8}} .* [0.9,0.9,0.8] = {0.63,0.45,{0.48,0.64}} Or {0.8,{0.3,{0.9,0.9}},0.3} .* [0.9,0.9,0.8] = {0.72,{0.27,{0.81,0.81}},0.24} Of course .* doesn't work with cell arrays. Can anyone help me to do this? Thanks, Ben |