Author Topic: Problem with Decoding the function to Parallel  (Read 579 times)

Offline alib022

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
Problem with Decoding the function to Parallel
« on: July 31, 2010, 04:24:52 PM »
hi
i'm a new programer in matlab i want to know if anybody can help me to decode
my function to parallel please:

function cal=cluster1
  clear all
  load listm2.txt;
  listm=listm2;
  cal=[];
  %load listm2.txt
  %listm=listm2;
  U=find(listm(:,1) ~= 0);
  while U ~= 0;
  clear cluster;
  %load listm2.txt
  %listm=listm2;
 
  F11=1;
  U=find(listm(:,1) ~= 0);
  if numel(U) ==0 break
  end
  s=listm(U(1),1);
  t=find(listm(:,1)==s);
  cluster=[s
      listm(t,2)];
  listm(t,:)=0;
 
  t=find(listm(:,2)==s);
  cluster=[cluster
      listm(t,1)];
  listm(t,:)=0;
  F1=size(cluster);
  F12=F1(1);
  for i=1:F12
  zz=find(cluster==cluster(i));
  xs=size(zz);
  xs=xs(1);
  if(xs >1)
  zz=zz(2:xs);
  cluster(zz)=[0];
  end
  end
  M=find(cluster(:) >0);
  cluster=[cluster(M)];

  F1=size(cluster);
  F12=F1(1);
  Fc=F12-F11;
 
  while Fc >0
  kk=F11; Fc=F12-F11; F11=F12;
  for i=1:Fc
 
  t=find(listm(:,1)==cluster(i+kk));
  cluster=[cluster
      listm(t,2)];
  listm(t,:)=0;
 
  t=find(listm(:,2)==cluster(i+kk));
  cluster=[cluster
      listm(t,1)];
  listm(t,:)=0;
  end
  F1=size(cluster);
  F12=F1(1);
  for i=F11-1:F12
  zz=find(cluster==cluster(i));
  xs=size(zz);
  xs=xs(1);
  if(xs > 1)
      zz=zz(2:xs);
  cluster(zz)=[0];
  end
  end
  M=find(cluster(:) >0);
  cluster=[cluster(M)];
  F1=size(cluster);
  F12=F1(1);
  Fc=F12-F11;
  end
 
  F1=size(cluster);
  F12=F1(1);
  cal=[cal
      F12];
  end

please help its really emergency!!![/s]

Offline England90

  • Jr. Member
  • *
  • Posts: 15
  • Matlab Forum
    • View Profile
Re: Problem with Decoding the function to Parallel
« Reply #1 on: September 28, 2010, 04:10:42 PM »
Run this program very good!

Matlab and SimuLink Development Forum

Re: Problem with Decoding the function to Parallel
« Reply #1 on: September 28, 2010, 04:10:42 PM »