I have created a cell array:
startSeedsX=cell(1,20);
Now I want each cell to have random number in the range 0 – 100:
startSeedsX=cellfun(@rand*100,startSeedsX);
Brings me error: Undefined operator '*' for input arguments of type 'function_handle'
I tried to put rand*100 in brackets (rand*100) or leave rand alone, doesn't help.
Is there a way to avoid for loop in that case?
Best Answer