Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Reducing the data of a big Matrix

Subject: Reducing the data of a big Matrix

From: mahdi roozbhani

Date: 6 Jun, 2011 02:44:04

Message: 1 of 2

It is very important for me to increase the speed of this code.
The matrix of A is my main matrix which is concluded x,y and z in first ,second and third column respectively and the length of Matrix A is 100,000.
c_0 is changed in every loop, so the matrix F has been changed in every loop.


F = zeros(100000,3);
for i = 1:100000
'
'
'
F = A(A(:,3)>c_0,:)
'
'
'
end

the F = A(A(:,3)>c_0,:) code takes 70% time of my code .How can I get rid of this problem ?

Subject: Reducing the data of a big Matrix

From: Steven_Lord

Date: 6 Jun, 2011 13:32:11

Message: 2 of 2



"mahdi roozbhani" <m.m.roozbahani@gmail.com> wrote in message
news:ishetk$rkh$1@newscl01ah.mathworks.com...
> It is very important for me to increase the speed of this code.
> The matrix of A is my main matrix which is concluded x,y and z in first
> ,second and third column respectively and the length of Matrix A is
> 100,000.
> c_0 is changed in every loop, so the matrix F has been changed in every
> loop.
>
>
> F = zeros(100000,3);
> for i = 1:100000
> '
> '
> '
> F = A(A(:,3)>c_0,:)
> '
> '
> '
> end
>
> the F = A(A(:,3)>c_0,:) code takes 70% time of my code .How can I get rid
> of this problem ?

Impossible to say without seeing how you use F.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us