MATLAB: Index exceed matrix dimension error

matrix manipulation

how to solve this? if m{7}== 0 m{7}= 0.000000001; else m{7} = m{7}; end since i get error "index exceed matrix dimension"

Best Answer

You have less than 7 cells in your variable m. Do the following to understand the error.
>> clear m; m=cell(6,1);m{7}
??? Index exceeds matrix dimensions.