Loop for multiple calculation
显示 更早的评论
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 个评论
Star Strider
2014-4-8
What is baseline?
Scalar?
Vector? What are its dimensions?
Thang Le
2014-4-8
Star Strider
2014-4-8
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
2014-4-8
Image Analyst
2014-4-8
OK, I've modified my answer code to take this new information into account.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!