Loop over a list of variables indexed by numbers
1 view (last 30 days)
Show older comments
Suppose I have a table
Day1Vistors Day1Sales Day2Visitors Day2Sales
NY 10 100 15 45
SF 5 20 10 50
Then I want to calculate Day1SalesPerVisitor, Day2SalesPerVisitor
I would lke to write a loop over variable names like
for i=1:2
DayiSalesPerVisitor=DayiSales./DayiVisitor;
end
How can one operationalize it?
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!