how can i pass a vector to a function?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
anu vru
el 8 de Feb. de 2018
Comentada: Ziyu Xu
el 23 de Oct. de 2019
i have a function which has 2 variables each of these variables are a vector. how do i pass vector inputs to the function???
0 comentarios
Respuesta aceptada
Birdman
el 8 de Feb. de 2018
function z=f(x,y)
z=x.^2+y.^2;
end
From command line, type
x=[1;2];y=[3;4]
z=f(x,y)
and the result would be
[10;20]
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Surfaces, Volumes, and Polygons en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!