Effacer les filtres
Effacer les filtres

for loop number of elements

1 vue (au cours des 30 derniers jours)
shobhit mehrotra
shobhit mehrotra le 4 Fév 2015
Modifié(e) : James Tursa le 4 Fév 2015
Hello I have this code so far, it wont run because the number of elements of winddivergencex is not the same number of elements as n because of the differentiation, how can I get this to work? Thanks
for n = 1:length(dataind)
winddivergencex(n)= (diff(Ui(min(dataind{n}):(max(dataind{n})))))./(diff(longm(min(dataind{n}):(max(dataind{n})))));
end

Réponse acceptée

Michael Haderlein
Michael Haderlein le 4 Fév 2015
Depending on Ui, dataind and longm, this could work:
winddivergencex(n,:)=...
or
winddivergencex(:,n)=...

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by