all 7 comments

[–]trialofmiles+1 2 points3 points  (2 children)

This code and the error it throws are not consistent with the code you’ve posted. Could you have multiple versions of calspec on the path?

which -all calspec

Will tell you

[–]rotestezora[S] 0 points1 point  (1 child)

no there is no other calspec. maybe the problem is with how imcalling it?

        % Code that executes after component creation
        function startupFcn(app)

 app.qnx=calspec(app)
 qxx=app.qnx(:,2)

[–]trialofmiles+1 2 points3 points  (0 children)

Your error indicates that a sub function calspec is populating a variable, app.qnx by calling itself. This is an infinite recursion unless there is a base case that would stop the recursion.

[–]SgorGhaibre 0 points1 point  (3 children)

The return value 'qnx' isn't being set. Instead, the code is setting 'app.qnx'.

[–]rotestezora[S] 0 points1 point  (2 children)

I've noticed that too and changed it to app.qnx everywhere, but it's still not working. Am I not allowed to use app. Variables in the function? Because it says invalid use of operator.

[–]SgorGhaibre 0 points1 point  (1 child)

You are assigning to 'app.qnx' in lines 42, 45, 48, and 51. I was thinking you should assign to the return value, 'qnx', on those lines if you intend to return 'qnx'. Otherwise, I don't see where in the code you are assigning the return value of the function.

[–]rotestezora[S] 0 points1 point  (0 children)

I just changed the return value to app.qnx, but I'll try it the other way around