MATLAB: How to input a matrix (variable) in a function

functionmatrix

I created a function:
.
x is the excitation wavelength where i will input eg. " test,wavelength(765,y)"
.
y is a 729 by 1 matrix: .
.
the result is:
.
.
where only the first number of y matrix is being implemented in the function. How do i create a function where the first number of y matrix will be implemented and return as a result as the first number in wavelengtha matrix and so on.

Best Answer

1) why you have comma in your function name?
2) Change your equation in element wise division as follow:
wavelengtha= 1./ ((1./x)-(y/10^7))