• Create Account

### #Actualsuliman

Posted 25 March 2013 - 08:57 AM

Hi
I never get any answer at the matlabcentral/answers so i try here!
I am modifying all values in a column and the below code works:
for i=1:size(A)   density=A(i,pressPos)*100/(287.05*(A(i,tempPos)));   A(i,windPos)=A(i,windPos)*power(density/densityNormal,1/3);end

But this is very slow as i have 200 000 rows in the matrix. Any way to do it column-wise instead of once per row? I try this but then i get memory problem and 'error using \' (see errors under the code)
density=A(:,pressPos)*100/287.05;density=density/A(:,tempPos);A(:,windPos)=A(:,windPos)*power(density/densityNormal,1/3);

MATLAB ERRORS GENERATED:

Error using \
Out of memory. Type HELP MEMORY for your options.
Error in scaleWind (line 31)
density=density/A(:,tempPos);
Error in getLongData (line 19)
A = scaleWind(A,avgWind);

### #2suliman

Posted 25 March 2013 - 07:30 AM

Hi

I never get any answer at the matlabcentral/answers so i try here!

I am modifying all values in a column and the below code works:

for
i=1:size(A)
density=A(i,pressPos)*100/(287.05*(A(i,tempPos)));
A(i,windPos)=A(i,windPos)*power(density/densityNormal,1/3);
end


But this is very slow as i have 200 000 rows in the matrix. Any way to do it column-wise instead of once per row? I try this but then i get memory problem and 'error using \' (see errors under the code)

density=A(:,pressPos)*100/287.05;
density=density/A(:,tempPos);
A(:,windPos)=A(:,windPos)*power(density/densityNormal,1/3);


MATLAB ERRORS GENERATED:

Error using  \
Out of memory. Type HELP MEMORY for your options.
Error in scaleWind (line 31)
density=density/A(:,tempPos);
Error in getLongData (line 19)
A = scaleWind(A,avgWind);

### #1suliman

Posted 25 March 2013 - 07:29 AM

Hi

I never get any answer at the matlabcentral/answers so i try here!

I am modifying all values in a column and the below code works:

for
i=1:size(A)
density=A(i,pressPos)*100/(287.05*(A(i,tempPos)));
A(i,windPos)=A(i,windPos)*power(density/densityNormal,1/3);
end


But this is very slow as i have 200 000 rows in the matrix. Any way to do it column-wise instead of once per row

? I try this but then i get memory problem and 'error using \' (see errors under the code)

density=A(:,pressPos)*100/287.05;
density=density/A(:,tempPos);
A(:,windPos)=A(:,windPos)*power(density/densityNormal,1/3);


Error using  \
Out of memory. Type HELP MEMORY for your options.
Error in scaleWind (line 31)
density=density/A(:,tempPos);
Error in getLongData (line 19)
A = scaleWind(A,avgWind);

PARTNERS