Varying vector from [0 100] to [100 0]
15 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Ismaeel Dasti
el 7 de Jul. de 2022
Comentada: Ismaeel Dasti
el 7 de Jul. de 2022
I have a function that takes a vector as an input. I want to run this function multiple times with a for loop while varying this vector from [0 100] to [100 0]. How can I vary this vector like that? Thank you.
2 comentarios
Chunru
el 7 de Jul. de 2022
Consider moving a point from [0, 100] to [100, 0] on a plane. How do you move it? You have to specify other conditions. For examples, you can mover the point uniformly along an arc on a circle, or a straight line between the 2 points.
Specfify your requirements first.
Respuesta aceptada
DGM
el 7 de Jul. de 2022
Maybe something like this?
npoints = 11;
v = linspace(0,100,npoints);
for p = 1:npoints
thisv = [v(p) v(npoints-(p-1))];
myfunction(thisv);
end
Ver también
Categorías
Más información sobre Loops and Conditional Statements 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!