If you are able to assign a numeric value to Rx(5) then at that time Rx must logically contain a numeric array. If later you attempt to assign to Rx{1,5} then MATLAB will complain that you are attempting to assign to cell array contents of a non-cell array. The only way you would have been able to assign to Rx{1,5} is if you cleared Rx first or you overwrote all of Rx in the assignment, effectively clearing it, leaving just a cell array.
Note that if you have a cell array with Rx{1,5} = 5 then Rx(1,5) is not the numeric value 5 but rather the 1x1 cell array {5}
If you assign sequentially to Rx{1}, Rx{2} and so on, then Rx will become a row vector of cells, and Rx{1} will in that case mean the same thing as Rx{1,1} and Rx{5} would mean the same thing as Rx{1,5} . This is the dual indexing feature of MATLAB, where any array element may be indexed by its full index list, or by its simple numeric index relative to the top-left of the array, with the simple numbering like
1 7 13
2 8 14
3 9 15
4 10 16
5 11 17
6 12 18
In this example, indexing the array at (3,3) would be the same as indexing the array at (15)
Best Answer