Prev: Rearranging arrays.
Next: Structure & Loop
From: Virtualized on 28 May 2010 14:53 Hi Everyone I have a question about using a different netCostMatrix than the one given in: http://www.mathworks.com/matlabcentral/fileexchange/27153-k-shortest-path Instead of using the netCostMatrix like the way given in the example: netCostMatrix = [inf 1 inf 1 ; 1 inf 1 1 ;inf 1 inf inf ;inf inf inf inf ]; I want to use the same graph(netCostMatrix) in a different way. N1 =[1 1 2 2]; N2 =[2 4 3 4]; W = [1 1 1 1]; n = max([N1(:); N2(:)]); DG = sparse([N1],[N2],W,n,n); UG = tril(DG + DG'); netCostMatrix = UG; But when i run it, it gives totally wrong results. Can anybody please guide me what should i do so that i can utilize the netCostMatrix the way i want to. Thanking you in anticipation. Best Regards
From: us on 28 May 2010 16:12 Virtualized <razzaqadil(a)gmail.com> wrote in message <a2868b7d-fd45-4040-8650-dd5441facfde(a)w3g2000vbd.googlegroups.com>... > Hi Everyone > > I have a question about using a different netCostMatrix than the one > given in: > http://www.mathworks.com/matlabcentral/fileexchange/27153-k-shortest-path > > Instead of using the netCostMatrix like the way given in the example: > netCostMatrix = [inf 1 inf 1 ; 1 inf 1 1 ;inf 1 inf inf ;inf inf inf > inf ]; > > I want to use the same graph(netCostMatrix) in a different way. > > N1 =[1 1 2 2]; > N2 =[2 4 3 4]; > W = [1 1 1 1]; > n = max([N1(:); N2(:)]); > DG = sparse([N1],[N2],W,n,n); > UG = tril(DG + DG'); > > netCostMatrix = UG; > > > But when i run it, it gives totally wrong results. > > Can anybody please guide me what should i do so that i can utilize the > netCostMatrix the way i want to. > > > Thanking you in anticipation. > > Best Regards a hint: - get in touch with the author of this FEX submission: Meral Shirazipour us
From: Virtualized on 28 May 2010 16:58 On May 28, 10:12 pm, "us " <u...(a)neurol.unizh.ch> wrote: > Virtualized <razzaqa...(a)gmail.com> wrote in message <a2868b7d-fd45-4040-8650-dd5441fac...(a)w3g2000vbd.googlegroups.com>... > > Hi Everyone > > > I have a question about using a different netCostMatrix than the one > > given in: > >http://www.mathworks.com/matlabcentral/fileexchange/27153-k-shortest-... > > > Instead of using the netCostMatrix like the way given in the example: > > netCostMatrix = [inf 1 inf 1 ; 1 inf 1 1 ;inf 1 inf inf ;inf inf inf > > inf ]; > > > I want to use the same graph(netCostMatrix) in a different way. > > > N1 =[1 1 2 2]; > > N2 =[2 4 3 4]; > > W = [1 1 1 1]; > > n = max([N1(:); N2(:)]); > > DG = sparse([N1],[N2],W,n,n); > > UG = tril(DG + DG'); > > > netCostMatrix = UG; > > > But when i run it, it gives totally wrong results. > > > Can anybody please guide me what should i do so that i can utilize the > > netCostMatrix the way i want to. > > > Thanking you in anticipation. > > > Best Regards > > a hint: > - get in touch with the author of this FEX submission: Meral Shirazipour > > us Ok & Thank You Best Regards
|
Pages: 1 Prev: Rearranging arrays. Next: Structure & Loop |