back Solution to exercise 2.1.3 The key to the solution is to calculate the last element of the sequence and then use operator : (colon) to generate the sequence. <sxh c> a = input(“Give sequence initial term : ”) d = input(“Give sequence difference : ”) N = input(“Number of terms : ”) a_last = a + (N-1)*d; % sequence's last term sequence = a:d:a_last; disp(sequence) </sxh> Download the script: nseq.m en/teaching/subjects/it/labs/sol_2_1_3.txt Last modified: 2017/10/02 15:54(external edit)