Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Apr 26, 2005
Messages
2
Location
US

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!
 
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

Back
Top