I have this code I'm trying to decipher but there are some commands I have no idea how to even start looking for the answer of what they do. I understand the first command is just a cumulative sum of the vector s_jt, but the next two I don't get what they're doing. cdindex is a vector of indices. I greatly appreciate any help.
temp = cumsum(s_jt);
sum1 = temp(cdindex,:);
sum1(2:size(sum1,1),:) = diff(sum1);

댓글 수: 3

Walter Roberson
Walter Roberson 2018년 11월 1일
Are the values in cdindex consecutive?
Sebastian Pinzon
Sebastian Pinzon 2018년 11월 1일
Not quite, it's an index of brand data (there's 24 brands) in different markets (94 markets). So cdindex looks like this: [24 48 72 ... 2256] and it's basically telling you the last row of the brand data for each market.
Walter Roberson
Walter Roberson 2018년 11월 2일
So the point of the code is to produce a subtotal of sales per brand?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Big Data Processing에 대해 자세히 알아보기

제품

질문:

2018년 11월 1일

댓글:

2018년 11월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by