Borrar filtros
Borrar filtros

Iterate through a meshgrid to calculate things based on those coordinates

30 visualizaciones (últimos 30 días)
Faith
Faith el 5 de Abr. de 2023
Respondida: Rik el 5 de Abr. de 2023
I currently have the meshgrid shown below. Drange1 and Drange 2 are arrays. I want to iterate through it so that for each set of Drange1 and Drange2 value I calculate something. I may be misunderstanding what exactly a meshgrid is, but any suggestions as to how to do this?
[X,Y] = meshgrid(Drange1,Drange2)
for % some parameter here to iterate through
% calculate here
end

Respuestas (1)

Rik
Rik el 5 de Abr. de 2023
If you use an index you can iterate through the array:
for n=1:numel(X)
x=X(n); y=Y(n);
end

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by