Loop for multiple calculation
Mostrar comentarios más antiguos
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 comentarios
Star Strider
el 8 de Abr. de 2014
What is baseline?
Scalar?
Vector? What are its dimensions?
Thang Le
el 8 de Abr. de 2014
Star Strider
el 8 de Abr. de 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
el 8 de Abr. de 2014
Image Analyst
el 8 de Abr. de 2014
OK, I've modified my answer code to take this new information into account.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!