MATLAB: How do i create numbered variables based on number of inputs

variables

How can I create different numbered variables, to use later in equations? example. GUI input is "5" point loads on a beam, now I want to create 5 lengths (l1,l2,l3,l4,l5) to find the moments from these loads.
Related Question