I run a program, which is a function - here I'll call it 'myfxn' - that output开发者_运维问答s several different variables. But when I try to access the data I get
??? Undefined function or variable 'myfxn'.
How do I access the data? Thanks for your help.
Your question is a bit confusing - you claim you run the function, but then you also say that Matlab throws an error indicating it can't run the function.
Here's two things to test
- Is
myfxnon the Matlab path? Run the commandwhich myfxn. If that does not find the function, change directory (usingcdor the directory browser on the Matlab Desktop) to wheremyfxnis located. - Does the function actually generate output? If it's a function, the first line should look something like this:
function [out1,out2] = myfxn(in1,in2), wherein1andin2are two input arguments, andout1andout2are output arguments. Then, you could callmyfxnlike this:[a,b] = myfxn(2,'something');, and it will use the two inputs to generate the two outputs, which are assigned toa, andb, respectively.
加载中,请稍侯......
精彩评论