2
votes

This should be a simple question for Matlab users out there.

The parameter y is 1 x 81 matrix (an array). My function looks like this:

function [  ] = test( y )

length(y)

end

Yet when call test I get the following error: "??? Attempt to reference field of non-structure array."
What did I do wrong?

2

2 Answers

1
votes

You need to specify a return parameter!

function [size] = test (y ) etc...
-2
votes

test is a built in function, already.

>> help test
 --- help for classregtree/test ---

 test Compute error rate for tree.
 COST = test(T,'resubstitution') computes the cost of the tree T

where T is a decision tree.