How do I input a matrix (variable) in a function?
Mostrar comentarios más antiguos
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.
1 comentario
the cyclist
el 22 de Oct. de 2014
The screenshots are very helpful in understanding your problem. I suggest not using them for the actual code, though, so that we can copy & paste your code into MATLAB ourselves.
Respuesta aceptada
Más respuestas (1)
the cyclist
el 22 de Oct. de 2014
I'm not sure I fully understand what you mean, but does this do what you intend?
wavelengtha = 1./((1./x) - (y/10^7));
Notice that I used element-wise division.
1 comentario
hithere
el 22 de Oct. de 2014
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!