Inconsistent Performance by MATLAB 2010b

1 次查看(过去 30 天)
Hi All (specially MATLAB developers)
I run the following code
for k=1:783
sortedfile=sortrows(tosort,k,'descend');
ranks(:,k)=sortedfile(:,1);
end;
it runs once very smoothly and produces a dataset array "ranks". Next time I run the same code, it gives the following error first
the following error occurred converting from dataset to double:
Error using ==> double
Conversion to double from cell is not possible.
also when I start my loop from 2:783 (bcoz first column contains asset names,I receive the following error:
??? Index exceeds matrix dimensions.
Also exporting 783 columns to XLS file is not allowed, when I write:
export(ranks,'XLSfile','rankfile2.xlsx');
it writes upto column 680 and returns and error number:
Error writing dataset variable 'Var690' to 'rankfile2.xlsx':
Excel returned: Error: Object returned error code: 0x800A03EC..
MATLAB gurus, plz reply....how to tackle with this.
Regards,
AMD.
  1 个评论
Jan
Jan 2012-4-29
Currently the question is not clear. What is the type of "tosort"? What does "next time I run the same code" mean: inside the same function, or calling the same function again, or with the same data? Did you pre-allocate the variable ranks? If so, to which type and dimensions?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by