Loop for multiple calculation
Afficher commentaires plus anciens
Hi everyone,
I have a bunch of calculations like this:
F1 = (H(4,1) - baseline1) / baseline1
F2 = (H(20,1) - baseline2) / baseline2
F3 = (H(36,1) - baseline3) / baseline3
...
F20 = (H(308,1) - baseline20) / baseline20
As you can see, the row in H goes up in an increment of 16. I thought a loop may be good for this but am unsure how to go about it. Does anyone have any suggestions?
Thanks,
Le
5 commentaires
Star Strider
le 8 Avr 2014
What is baseline?
Scalar?
Vector? What are its dimensions?
Thang Le
le 8 Avr 2014
Star Strider
le 8 Avr 2014
Are you storing baseline1 and the rest, or are they one-offs?
I ask because you could as easily store them as baseline(1), etc. That would make it much easier for you to reference them in a loop.
Is H a vector (308x1) or matrix?
(I’m doing my best to figure out what you are doing.)
Thang Le
le 8 Avr 2014
Image Analyst
le 8 Avr 2014
OK, I've modified my answer code to take this new information into account.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!