MATLAB: Functions and For loops

darkness golfdoit4mefor loopfunctiongolfhomework

I need help with my homework, I am stumped on this question.
create a new function (Call it until) that takes as an argument an intefer n and spits out the vector x=(1,2,3,…,n)

Best Answer

I am not sure if that is what you are looking for. This function will display numbers from 1 to n. copy and paste this on a new M-file and save it with the name 'until'.
function [x]=until(n)
n=input('enter the number:'); x=[1:1:n]