reading data in loop

2 views (last 30 days)
Mingde on 20 Jul 2022
Edited: dpb on 20 Jul 2022
I have some problem with reading data in loop
cx_sum(Q) and cy_sum(Q) are not working in loop.
cx_sum and cy_sum have value 1x1622.
for Q = 1:1621
CY_sum99 = mean(cy_sum(Q),'omitnan')
CX_sum99 = mean(cx_sum(Q),'omitnan')
So can you solve this problem? Thank you

Accepted Answer

dpb on 20 Jul 2022
But they are .. just that cy_sum(Q) is the single element of the array on each pass and the mean of a single number is the number and so the last computed value at the end of the loop is the last element of each array (if not NaN) .
You're looking for simply writing
probably...but that's guessing.
Mingde on 20 Jul 2022
Thank you so much. I appreciate it your answer.

Sign in to comment.

More Answers (0)


Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!