Code Comments
Programming Forum and web based access to our favorite programming groups.I am creating a function that needs to have two ouputs but I can only
get it to output one or the other and not both at the same time. Here
is the function
function [ljError ljValue] = ljud_eGet(ljHandle, IOType, Channel,
ljValue, x1);
[ljError ljValue] =
calllib('labjackud','eGet',ljHandle,IOTy
pe,Channel,ljValue,x1);
with the mfile as above I get "ans = 0", which is correct for the
ljError value. If I change the first part of the function to read
"function [ljValue] = ......" then I get "ans = 4.67" which is also
correct.
How can I change my function so that if outputs both? The preferred
output would be "ans = 0 ans = 4.67".
Also, I intend to call this function from other mfiles. Right now I
call it by writing:
AIN0 = ljud_eGet(ljHandle,10,0,0,0);
Is there a way to call the function from an mfile so that it places
both function outputs into variables in the current mfile? Maybe
somethinglike the following:
[Error AIN0] = ljud_eGet(ljHandle,10,0,0,0);
Thanks in advance for your help.
Post Follow-up to this messageAndy Pilkington: <SNIP slight confusion of a ML newcomer... created a func with two output args and wants to see both AIN0=afunc(someargs); % wrong [Error,AIN0]=afunc(someargs); % right us
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.