0

i have to find distance between two projects and i have taken three attributes for this purpose which are size, project mode and a constant value.i have written code in matlab 7.but it gives error.plz see the folowing code and help me.

t = 17;

a =0;
b=0;

%size
effort = 12;
effort1=14;
if ((z=46) & (j=1.15))
a = effort;
end;


h=1;
h1 = 2;

% sum of importance weights of current project
s = z + j ;

b = s / t;

if ((z1=50) & (j1=1.15))
b = effort1;
end;

% sum of weights of previous project
e = z 1+ j1+ h1 ;

f = e / t;
p = 24.5 ;
g = f * p;

% distance
d = b - g;

disp(d)

error is:

??? Error: File: I:\MCS\MSc\matlabinstalled\work\efffff.m Line: 9 Column: 7
The expression to the left of the equals sign is not a valid target for an assignment.


plz help me to overcome this error.

4
Contributors
10
Replies
11
Views
6 Years
Discussion Span
Last Post by pyTony
0

thanx .

i have made some changes.

t = 17;

a =0;
b=0;
z=0;
z1=0;
j1=0;
%size
effort = 12;
effort1=14;
if ((z==46) & (j==1.15))
a = effort;
end;


h=1.0353;
h1 = 1.0028;

% sum of importance weights of current project
s = z + j ;

b = s / t;

if ((z1==50) & (j1==1.15))
b = effort1;
end;

% sum of weights of previous project
e = z1+ j1+ h1 ;

f = e / t;
p = 24.5 ;
g = f * p;

% distance
d = b - g;

disp(d)

but is giving folllowing resultant value which is not desirable. i need value between 0 and 1:

-1.4452 + 0.0588i

0

i dont know what is "i" in resultant value? what is this?

0

It's a complex number.

You're using the letter 'j' in some places, and in matlab that's hardcoded to have the value i.

Edited by Rashakil Fol: n/a

0

How about you review your code and prove it doesn't have any problems, or notice what the problems are? Seriously can't you double check things carefully? Has that idea ever cross your mind?

Edited by Rashakil Fol: n/a

0

what do you mean to say "Rashakil Fol " ? plz tell the solution of my problem.i have left with very short time for it.

0

From your posting:

if ((z==46) & (j==1.15))

What is the value of 'j' here? Where did it get set to that value? Do you use 'j' anywhere else in your code?

Votes + Comments
I'm giving you bad rep not because I hate you or anything, but because the OP doesn't deserve it.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.