Hi there, I have 796×1 cell array consisting of 1×1 scalar arrays, or empty arrays. E.g.
>> ses1_results = {1.192;0;0;0;0.5678;0;0;0;0;0;0;1;[];1}ses1_results = 14×1 cell array {[ 1.1920]} {[ 0]} {[ 0]} {[ 0]} {[ 0.5678]} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[ 0]} {[ 1]} {0×0 double} {[ 1]}
The spacing of the 0s is irregular
I need to remove all the cells with 0, whilst maintaining the 0x0 cells and the values>0, and then convert that into an array. How can I do this? I've spent a few hours trying to do it like this but can't seem to figure it out:
Rxtcell = ses1_results(5:800,6);for n = 1:796 Z = [] Q = 0 x = Rxtcell(n) if 1 == strcmp(x,Q) Rxtcell{n}=[999]; elseif 1== strcmp(x,Z) Rxtcell(n)= [0]; else endendRxTa = cell2mat(Rxtcell)
Best Answer