Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Matlab Funtion Outputs
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Andy Pilkington
04-28-05 02:01 AM


Re: Matlab Funtion Outputs
Andy 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

Report this thread to moderator Post Follow-up to this message
Old Post
us
04-28-05 02:01 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Matlab archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:33 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.