Hi Guys, I have a bunch of cell values continaing 17 unifrom sized matrices that have NaN values in them. I need to replace these NaNs with any large place-holder number. I am trying to use a solution that has shown up in other posts:
https://www.mathworks.com/matlabcentral/answers/440856-replacing-nans-with-zero-in-a-matrix-within-a-cell-array
https://www.mathworks.com/matlabcentral/answers/459133-how-to-replace-nan-values-with-any-other-values-in-a-cell-array
Here is my code
RvarNnan1 = cellfun(@(M) subsasgn(M, substruct('()', {isnan(M)}), 123000), RvarNnan1, 'UniformOutput', 123000);
I am getting the following errors, prior to running:
"output must be assigned to a variable"
and after running get :
"Error using cellfun
Non-scalar in Uniform output, at index 1, output 1.
Set 'UniformOutput' to false."
I think i don't understand the "M" variable. I've attached my cell variable(this is a sliced version {5x1}, of the actual variable {17x1} due to upload size restraits. Also of note, different from the other posts, I am replacing the NaNs with a meaningless large number. I have tried switiching around M with a predifenedvariable as well as using the actual VarNnan1.
Any help here is greatly appreciated!