Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

need a small help with a simple code

Status
Not open for further replies.

ceceraj

Civil/Environmental
Jan 6, 2006
1
Code:
hi,
I need a help with the code, I am unable to figure out how to get the desired output. I am new to matlab. Please help.

the code:
for p=1:resr(think resr=7.......p= 1 to 7 it will test first 1 then 2, 3,4 .....7 same like for loop in C)
[valmax,inmax]=max(res(p,:))/matlab command valmax= row, inmax=column/
if(valmax>0.7)&(valmax<=1)
concentration = 'High';
end
if(valmax>0.4)&(valmax<=0.7)
concentration = 'Medium';
end
if(valmax>=0.1)&(valmax<=0.4)
concentration = 'Low';
end
if(valmax<0.1)
concentration = 'No';
end
concentration..

Output
first 1st row as
'low'
second row as
'high'
third row as
'medium'
like 7th row as
'low'

The desired output
1st row as
'low'
second row as
'low'
'high'
third row as
'low'
'high'
'medium'
like 7th row as
'low'
''
''
''
''
''
''(7times)

Any help is really really appreciated.
thanks
cece
 
Replies continue below

Recommended for you

What do you want to do? how did you get this far? In your development of this code, where did it stop working and what did you introduce that gave you the unexpected oputput?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor