I have a function of the form:
[x, y, z]=myfunc(a, b, c, d)
where a is a function handle, b is a structure and the rest are all vectors.
When I call the function from within a script I get the following error:
"Direct access of structure fields returned by a function call (e.g., call to myscript) is not allowed"
The help refers me to dealing with structures returned from a function call, but I don't have any structures returned, only vectors. The only structure here is an input to the function. I have tried the suggested help of assigning the the structure to another variable (both in the main script and within the function), but it doesn't seem to work, and I'm not sure that this situation applies here.
Anyone have an ideas?
Cheers
Greig
|
|
0
|
|
|
|
Reply
|
Greig
|
8/25/2010 4:29:05 AM |
|
On 24/08/10 11:29 PM, Greig wrote:
> I have a function of the form:
>
> [x, y, z]=myfunc(a, b, c, d)
>
> where a is a function handle, b is a structure and the rest are all
> vectors.
>
> When I call the function from within a script I get the following error:
>
> "Direct access of structure fields returned by a function call (e.g.,
> call to myscript) is not allowed"
Does your script contain any attempts to invoke functions or scripts by
naming the complete .m file? Such as (e.g)
InitializeThings.m %Set up my variables
If so then you need to get rid of the .m
|
|
0
|
|
|
|
Reply
|
Walter
|
8/25/2010 4:59:27 AM
|
|
Walter Roberson <roberson@hushmail.com> wrote in message <Pq1do.64866$Zp1.18588@newsfe15.iad>...
> On 24/08/10 11:29 PM, Greig wrote:
> > I have a function of the form:
> >
> > [x, y, z]=myfunc(a, b, c, d)
> >
> > where a is a function handle, b is a structure and the rest are all
> > vectors.
> >
> > When I call the function from within a script I get the following error:
> >
> > "Direct access of structure fields returned by a function call (e.g.,
> > call to myscript) is not allowed"
>
> Does your script contain any attempts to invoke functions or scripts by
> naming the complete .m file? Such as (e.g)
>
> InitializeThings.m %Set up my variables
>
> If so then you need to get rid of the .m
Aha! So simple, all sorted now.
Cheers
Greig
|
|
0
|
|
|
|
Reply
|
Greig
|
8/25/2010 5:13:04 AM
|
|
|
2 Replies
438 Views
(page loaded in 0.018 seconds)
Similiar Articles: How to make struct from workspace available in m-file s-function ...Hey everybody, I'm evaluating a function expression by using a m-file s-function within my simulink model. Therefore I offline calculate a coefficient structure and ... Using Handles structure with ButtonDownFcn - comp.soft-sys.matlab ...Using Handles structure with ButtonDownFcn - comp.soft-sys.matlab ... However, I have been using the handles structure in several other functions in the GUI without ... How can I rename a structure name inside a loop? - comp.soft-sys ...I tried saving the new structures under > a universal name and then use 'eval' function but it didn't work. > > Thank you > Hadi I think you are using some ... Plotting Functions - Logarithmic Decrement - comp.soft-sys.matlab ...Hi I would like to plot the logarithmic decrement of a structures transient vibration response signal so I can calculate its damping ratio. I ca... Assignin into Matlab variable struct - comp.soft-sys.matlab ...Either by loading the coefficient structure into the m-file s-function just ... Save workspace variables to file - MATLAB... table shows the available MAT-file ... Structure array size 1x1 - comp.soft-sys.matlabThese two variables belong together and they are passed through a lot of functions. ... matlab how to read a field from structured array - comp.lang.idl-pvwave ... Structure ... Structure to matrix - comp.soft-sys.matlab> I want to turn the structure into a single matrix again. > How do I do this? ... comp.soft-sys.matlab Bezout matrix - comp.soft-sys.matlab Is there any function to ... create a struct in mexFunction - comp.soft-sys.math.scilab ...Create a function to read excel from point A to point B - comp ... create a struct in ... mexFunction and its ... routine, you can access the data in the mxArray structure ... find / ismember / index within structure array - comp.soft-sys ...> > I have a structure array containing two double arrays and one cell array: > > S ... > > I also used this function idx_X = find(ismember(names, 'X')==1), but it just works ... Structure array HELp - comp.soft-sys.matlabCreate structure array - MATLAB - MathWorks - MATLAB and Simulink ... This MATLAB function creates a structure array with the specified fields and values. Structure Functions - University of Wisconsin Lidar GroupStructure Functions. A cirrus cloud-nocloud horizontal structure function was calculated for the three hour time period, 18:08 - 21:20 GMT (Figure 5), using the ... Structure and FunctionStructure and Function in Living Systems (5-8) * Important levels of organization for structure and function include cells, organs, tissues, organ systems, ... 7/21/2012 8:47:18 PM
|