Pages: [1] 2 3 4 ... 10

1 -  Matlab / Matlab Programming / Problem with Decoding the function to Parallel

Started by alib022 - Last post by alib022 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]

2 -  Matlab / Matlab Programming / problem optimization with fmincon

Started by nauleau17 - Last post by nauleau17 on: July 26, 2010, 01:29:46 AM

Hi!
I am working on simulations of a computing permit trading system. To do that, I am solving an minimization problem (objective function=addition of convex functions) under linear inequalities constraints. The unknowns stand for a (300,1) matrix at least for a beginning. I am using fmincon of the optimization toolbox.
Depending on my data, when I modify the level of my constraints, when I increase the size of the matrix of the unknowns or when I slightly change the objective function for example, it often occurs that the procedure is qualified as “unreliable”, which I don’t understand what it means. As I don’t dare to take into account these “unreliable results”, I have limited choice as for the simulations and I can’t do the ones I need. Could you help me to tackle that problem? Especially, what does “unreliable” mean in this case and what can I do to solve that?
Moreover, other matlab functions could exist and be better fitted for my situation or have more powerful algorithm. Do you know others I could use?
Thank you very much for all the advices you can give me.
Marie-laure

3 -  Matlab / Graphics & Image Processing / pedestrian detection with PCA & SVM

Started by andrean_voo - Last post by andrean_voo on: July 24, 2010, 12:25:23 PM

how to make pedestrian detection with method Principal Component Analysis (PCA) and Support Vector Machine?? in this case, picture pedestrian only di input via browse button. please help me....

4 -  Matlab / Matlab Programming / B/W image. Intensity is 0 instead of 1 for some points outside the image

Started by eeiatin - Last post by eeiatin on: July 23, 2010, 03:35:17 PM

Hi all,
I am kind of new to MATLAB so maybe this is a silly question...
Hope somebody there can help me.
 
I am trying to write a program to find the edges of a B/W image.
I(x,y)=1 for points outside the image (white)
I(x,y)=0 for points on the image (black)
 
However my program has found that some points have I(x,y)=0 even when they are not on the image.
I have tracked down those values on the picture and they are on the white area. So the value of Intensity there should be 1.
However when I try I(x,y) manually for those particular points, the value is 0.
 
Does anybody have any idea of what's going on??
 
Thanks a lot!
 
 
 

5 -  Matlab / Matlab Programming / Linear equations

Started by taraba989 - Last post by taraba989 on: July 16, 2010, 01:07:33 PM

Hello to everyone,
 
Could anyone help me, I have a problem while trying to solve linear equations with matlab.
The problem is:




\begin{alignat}{7}a_{11} x_1 &&\; + \;&& a_{12} x_2   &&\; + \cdots + \;&& a_{1n} x_n &&\; = \;&&& b_1 \\a_{21} x_1 &&\; + \;&& a_{22} x_2   &&\; + \cdots + \;&& a_{2n} x_n &&\; = \;&&& b_2 \\\vdots\;\;\; &&     && \vdots\;\;\; &&                && \vdots\;\;\; &&     &&& \;\vdots \\a_{m1} x_1 &&\; + \;&& a_{m2} x_2   &&\; + \cdots + \;&& a_{mn} x_n &&\; = \;&&& b_m. \\\end{alignat}


I want to solve it using matrix method, but when I type exact coefficients, matlab "says" :


-Undefined function or variable 'a'.
I don`t want to solve it in special case(for example: a=4, b=2...) I need to have general numbers but then the problem is unidentification.


Thanks!!!

6 -  Matlab / Matlab Programming / Who can help me to solve my problem with programming in MATLAB software?

Started by jantjon - Last post by jantjon on: July 14, 2010, 11:55:58 AM

i have some problem in programming with MATLAB software.i have a matrixwith one column and some rows.this matrix incloud some zeros andnon-zeros arrays.i would like to display non-zeros arrays and therelative number of row,in a suitable way.

7 -  Matlab / Matlab Programming / uicontrol callback

Started by world - Last post by world on: July 13, 2010, 11:33:47 AM

i want to make GUI using uicontrol that adds , subtracts , multiplies , divides two numbers , but it give me
Undefined function or variable 'pushbutton_callback'
Error while evaluating uicontrol Callback
please correct it

8 -  Matlab / Matlab Programming / How can I plot this equation?

Started by theasus - Last post by theasus on: July 09, 2010, 11:06:49 AM

I want to plot this equation;
 

Uploaded with ImageShack.us
 
This plot's axes will be y(t)-x(t). Could you purpose any code for this operation.

9 -  Matlab / Matlab Programming / making a while loop

Started by TheGame0135 - Last post by TheGame0135 on: July 06, 2010, 05:40:59 PM

I'm fairly new to MATLAB, and I've been trying to make an m file. What I want this to do is the following...
 
I have a data sheet (effectively could be infinite columns and rows long)
I need to find weighted average of my data.
So for example say I have this data sheet
 
A   B   C
2   0   43
2   0    45
3   2    56
1   3    22
1   4    20
2   5    45
2   7    46
2   8    45
2   9    42
 
Okay so column A is the group they're catagorized in, IE, 0-25 is 1, 25-50 is 2, etc...
column B is seconds notice readings were sometimes taken during the same second therefore it is counted as one.
So what I need to do. Is make a code where I can find weighted average of C compared with time, But i need total time and not just max time minus min time because that doesn't work. and since they have breaks I wanted to be able to do something ot the extent of, in accordance with my fake data sheet, take the first 2 values subtract their time then multiple by the average of the first 2 C's. then go down to the next set of 2's and do the same thing? does this make sense? if not I can try to explain further thanks.
 

10 -  Matlab / Matlab Programming / Matlab pump control

Started by skini - Last post by skini on: July 02, 2010, 10:28:27 AM

I need to use the Matlab for controling water pump speed which will control water level in a small tank. Water pump (windshield-water pump, 12v) is connected to DC-DC converter controller which is control by Matlab (0-5V).
Water level is messured by pressure sensor and this is INPUT.
So this is what i need from Matlab:

When input in Matlab is 0-0.5V, OUT must be 5V.
When IN is 2.5V, OUT must be 3V. If Input then raises over 2.6V, OUT must decrease for 0.5V. If it raises again, then OUT must again decrease by 0.5V. And so on till IN stops raising.
If Input is then lower than 2.4V, then OUT must raise for 0.5V. And if it sill raises, again 0.5V increase in OUT and so on...
When IN is 4V, OUT must be 0V.

So if someone can help me to write code in Matlab that will do that.
Thank You.

Pages: [1] 2 3 4 ... 10