Effacer les filtres
Effacer les filtres

appending to vector in a for loop

1 vue (au cours des 30 derniers jours)
shobhit mehrotra
shobhit mehrotra le 4 Fév 2015
Commenté : Geoff Hayes le 5 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? I want to add a zero term to the end of vector such that the elements are the same length. Thanks
for n = 1:30
winddivergencex(n)= (diff(Ui(min(dataind{n}):(max(dataind{n})))))./(diff(longm(min(dataind{n}):(max(dataind{n})))));
end
  1 commentaire
Geoff Hayes
Geoff Hayes le 5 Fév 2015
Shrobhit - what are the dimensions of your vectors like dataind? Note that you say that the number of elements of winddivergencex is not the same number of elements as n. Which elements of winddivergencex (the row or column)? Note also that n is changing on each iteration of the loop...

Connectez-vous pour commenter.

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