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:
flow,ceil, sortrows

Subject: flow,ceil, sortrows

From: Gervais Mady

Date: 12 Jun, 2012 02:14:07

Message: 1 of 2

hi,
i need someone to explain me these following matlab code
thanks.
function [NodeFlowMetric,MinHopMetric]=FlowCreate(NodeInfo,InterFlowNo,ExterFlowNo)
global NodeAmount; %????
global TransDistance; %???????


NodeFlowMetric=zeros(NodeAmount,(InterFlowNo+ExterFlowNo));
MinHopMetric=zeros(1,(InterFlowNo+ExterFlowNo));
NodeInfo=sortrows(NodeInfo,-4);
for i=1:InterFlowNo
    Source=ceil(NodeAmount*rand);
    while Source<3
          Source=ceil(NodeAmount*rand);
    end
    Destination=ceil(NodeAmount*rand);
    while Destination<3 || Destination==Source
          Destination=ceil(NodeAmount*rand);
    end
    SourceNode=NodeInfo(Source,1);
    DestinationNode=NodeInfo(Destination,1);
    NodeFlowMetric(SourceNode,i)=-1;
    NodeFlowMetric(DestinationNode,i)=1;
    SDDistance=((NodeInfo(Source,2)-NodeInfo(Destination,2))^2+(NodeInfo(Source,3)-NodeInfo(Destination,3))^2)^0.5;
    MinHop=ceil(SDDistance/TransDistance)+1;
    MinHopMetric(1,i)=MinHop;
end

Subject: flow,ceil, sortrows

From: Steven_Lord

Date: 12 Jun, 2012 13:32:56

Message: 2 of 2



"Gervais Mady" <gervais.mady@gmail.com> wrote in message
news:jr68lf$aoj$1@newscl01ah.mathworks.com...
> hi,
> i need someone to explain me these following matlab code

You should ask the author of the code.

*snip*

--
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