×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*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.

Students Click Here

Jobs

Function outputs

Function outputs

Function outputs

(OP)

Hi,

I was working with some Matlab and all was well, till all my m-files just stopped outputting what they were supposed to. Now I just get "ans= whatever" even if there are supposed to be 4 outputs.
how can I fix this?

Haven't used Matlab in quite a while and am rusty...

Thanks!

RE: Function outputs

I suggest you refresh your memory by reading the matlab documentation on function syntax.

If you have a function with 4 outputs you need to call it with

"[output1 output2 output3 output4] = myfunc(x,y,z)"

"output = myfunc(x,y,z)" will just return output=output1

M

 

--
Dr Michael F Platten

RE: Function outputs

(OP)

Thanks Mikey,

I am trying to catch up.

Thing is, the function is built properly (I got it off the mathworks site), and it DID work before.
I've even stepped through each line to see that it's ok. The data is all there it just deosn't create the output variables...

Thanks again,
Daphne

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.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources