squeeze function returning "NaN"

1 view (last 30 days)
Julia Laing
Julia Laing on 5 Apr 2022
Commented: Julia Laing on 6 Apr 2022
Hello everyone,
I'm trying to run a correlation between a 8, 8, 33 matrix (FC_mat) and a 33, 1 matrix, therefore, I'm trying to use the 'squeeze' function on the 8, 8, 33 matrix:
for regNum1=1:8;
for regNum2=1:8;
input1=FC_mat(regNum1,regNum2,:);
FC_mat_squeeze=squeeze(input1);
end
end
"FC_mat_squeeze=squeeze(input1);" is returning a 33, 1 matrix of all "NaN". There are NaN values along the diagonal of the "FC_mat" matrix.
I appreciate any insight any of y'all might have on getting the squeeze function to ignore the NaN's in the input.
Thanks!

Answers (1)

Paul
Paul on 6 Apr 2022
squeeze() can't ignore anything. If the input to squeez() is 1 x 1 x 33 matrix of NaN, the ouptut will be 33 x 1 of NaN. What is the desired result if input1 is 1 x 1 x 33 of NaN?
  5 Comments
Julia Laing
Julia Laing on 6 Apr 2022
Thanks for those recommendations. Adding in the line to detect the NaN's and skip that processing is still giving me an output of all NaN's. I'll keep trying to mess with things to work around this issue.
Thanks for your help!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!