How to extract only first few values of step function and perform arithmetic operations on those values?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
yr(i1,:) = step(tf1) - error part
for i2 = 1:N
yy(i1,i2) = yr(i1,i2)
end
j(i1,1:N) = (y0(1,:) - yy(i1,:)).^2 - error part
J(i1) = sum(j(i1))
Result of yr is a huge set of 1128 columns of values out of which i only want the first 10 or so and then how to subtact the corresponding of the set from another set and square the obtained results.
1 commentaire
Réponses (1)
Sarah
le 4 Jan 2015
From what I understand of your question, you need only the first 10 columns of yr. If this is so, then I would run my loop only 10 times and store the values of the columns in another vector. Then I can perform whatever operations I need with it.
for i=1:10 vector(:,i)=yr(:,i) end
0 commentaires
Voir également
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!