×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Problem with Metlab code

Problem with Metlab code

(OP)

Hi!
I would like you to help me with the MetLab code below. I do not know where I am wrong. Can a member help me?

CODE --> -8

xl=1 xu=2 x1=-4:0.01:4; y=polyval(p1,x1); plot(x1,y1) grid xlabel('oi times tou x') ylabel ('oi times tou y') for i=1:16 mesi=(xu+xl)/2; timixu=polyval (p1,xu); timixl=polyval (p1,xl); timimesi=polyval(p1,mesi); if timimesi*timixu<0 xl=mesi result=mesi; else xu=mesi result=mesi; end end
p2=[-1 2,71^1 -4] xl=1 xu=2 sfalma=1 i=0 resultold=2 x2=-4:0,01:4; y2=polyval(p2,x2); plot(x2,y2) grid xlabel('oi times tou x') ylabel ('oi times tou y') while sfalma>0,00001 mesi=(xu+xl)/2 timixu=polyval (p2,xu) timixl=polyval (p2,xl) timimesi=polyval (p2,mesi) if (timimesi*timixu<0) xl=mesi else xu=mesi end result=mesi; sfalma=abs((result-resultold)/result*100) result=resultold i=i+1 end] 
Replies continue below

RE: Problem with Metlab code

Student forum QC expert system v0.12 alpha

Recommendation - Need to improve question.

Please provide a better explanation of what you are trying to achieve.
Debug 68504913

You write uncommented code. So do I occassionally but expect no sympathy when it comes to debugging

You have at least one syntax error and one variable that has not been initialised

Cheers

Greg Locock

New here? Try reading these, they might help FAQ731-376: Eng-Tips.com Forum Policies http://eng-tips.com/market.cfm?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!