Home / Expert Answers / Computer Science / matlab-coding-use-nested-loops-and-vectors-q1-30-marks-total-basic-user-input-output-iteration-pa411

(Solved): Matlab coding use nested loops and vectors Q1 (30 marks total): basic user input/output, iteration ...



Matlab coding use nested loops and vectorsQ1 (30 marks total): basic user input/output, iteration (loop), vectors
Write a script that:
reads in \( \mathrm{n} \) number

Q1 (30 marks total): basic user input/output, iteration (loop), vectors Write a script that: reads in \( \mathrm{n} \) numbers from the user (10 marks) storing the numbers in a vector (10 marks). Then print the numbers from the ends inwards (last, first, second last, second, third last, third......) (10 marks). Sample Output: How many numbers will you enter?: 5 Enter a number: 3 Enter a number: 5 Enter a number: 6 Enter a number: 4 Enter a number: 3 Your numbers from outside to middle are: \( \begin{array}{lllll}3 & 3 & 5\end{array} \) Submit your solution as q1.m


We have an Answer from Expert

View Expert Answer

Expert Answer


This is the source code for the program i.e. basic user input/output, iteration(loop), vectors import numpy as np n = int(input('How many numbers will you enter?: ')) list1 = [] for i in range(n): num = int(input("Enter a number: ")) list1.append(num
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe