Clear Filters
Clear Filters

Inconsistent Performance by MATLAB 2010b

1 view (last 30 days)
ARS
ARS on 29 Apr 2012
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 Comment
Jan
Jan on 29 Apr 2012
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?

Sign in to comment.

Answers (0)

Categories

Find more on Shifting and Sorting Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!