Hi,
I have a cell array O which stores the output of an iterative algorithm. After each 1000 iteration, I want to save the last 1000 rows of O in a .mat file and append it to the previously saved O,
O is a 20000×2 cell array. Each cell in the first column consists of a 95×4 cell which again consists of 1×5 cells. The second column is a 1×1 matrix.
In the 1000th iteration, I want to save the first 1000 rows of O in a .mat file.
In the 2000th iteration, I want to save the second 1000 rows of O (1001th row to 2000th row) and append it to the previously saved .mat file.
In the 3000th iteration, I want to save the third 1000 rows of O (2001th row to 3000th row) and append it to the same .mat file.
and so on……
I use the following code:
if rem(it,1000) == 0 save('O.mat',O(it-999:it), '-append'); end
and I receive the following error:
Can someone please help me with this?
Error using saveMust be a string scalar or character vector.Error in HMainCode (line 90) save('O.mat',O(it-999:it), '-append');
Best Answer