Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Function outputs

Status
Not open for further replies.

ChemEgal

Chemical
Apr 26, 2005
2

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!
 
Replies continue below

Recommended for you

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
 

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor