i’m struggling to understand just how to call a Matlab duty from Labview. I’m using Labview 2020 SP1 and also I’ve developed the following m record (saved to mine desktop):

function A = test()A1,1=ones(1,3);A1,2=ones(1,4);end In Labview I’ve included a Matlab script node and imported the function. But when i click operation I gain the adhering to error:

Error arisen while executing script. Error blog post from server: ??? Error: Function an interpretation not supported in this context.Functions deserve to only be produced as regional or nested attributes in password files.

You are watching: Error: function definition not supported in this context. create functions in code file.

I was expecting the function to have the ability to run but do nothing as I’ve not included any outputs to the Matlab script node.

Can anyone suggest me to where I’m going wrong? i have looked with the Labview examples but they just seem to show calling a Matlab script not a function.

matlab labview
improve this inquiry
request Mar 19 at 11:20

6355 bronze badges
include a comment |

1 answer 1

energetic earliest Votes
Firstly the function would should be in MATLAB"s path (which generally wouldn"t include the present user"s desktop). MATLAB"s route is a perform of document locations that MATLAB will certainly search in to find a function definition.

You have the right to view/edit the current path by typing pathtool into MATLAB"s interactive command home window which will bring up a GUI.

Then your MATLAB manuscript node should be able to call the function as listed below - keep in mind I have included an output just to check the an outcome of the call.


This photo is a "LabVIEW Snippet" so friend should be able to drag and drop it directly into the block diagram of a brand-new VI and then save and run the VI.

improve this answer
edited Mar 19 in ~ 16:29
reply Mar 19 at 13:30

1,13977 silver badges1919 bronze title
add a comment |

your Answer

Thanks because that contributing response to ridge Overflow!

Please be sure to answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding to other answers.Making statements based on opinion; ago them up with referrals or an individual experience.

To discover more, see our advice on writing good answers.

See more: Veterans Memorial Civic And Convention Center Events & Tickets

Draft saved
Draft discarded

Sign increase or log in in

sign up making use of Google
authorize up utilizing Facebook
authorize up making use of Email and Password

Post together a guest

email Required, yet never shown

Post as a guest


Required, yet never shown

write-up Your price Discard

By click “Post your Answer”, you agree come our regards to service, privacy policy and cookie plan

Not the answer you're spring for? Browse various other questions tagged matlab labview or questioning your own question.

The Overflow Blog
Upcoming events
Featured on Meta
MATLAB parallel toolbox, remoteParallelFunction : RUNTIME_ERROR during function evaluation
MATLAB function Interface Error
how to pass debates to python script comparable to MATLAB role script?
create DLL wrapper in C code for Matlab/LabView interfacing
LabVIEW utilizing C DLL utilizing OpenCV DLL
trying to call a LabVIEW dll right into python the invokes a deserve to protocol
exactly how Matlab knows the function that a vector is developed by to calculate cumtrapz?
how to deal with the line find error in a minimization trouble using 'fminunc' in MATLAB?
hot Network questions much more hot inquiries

inquiry feed
i ordered it to RSS
inquiry feed To i ordered it to this RSS feed, copy and also paste this URL into your RSS reader.


stack Overflow
stack Exchange Network
site style / logo design © 2021 ridge Exchange Inc; user contributions licensed under cc by-sa. Rev2021.10.22.40552

Stack Overflow works ideal with JavaScript permitted

her privacy

By clicking “Accept every cookies”, you agree stack Exchange have the right to store cookie on your device and disclose info in accordance v our Cookie Policy.