Asked by Chaou
on 28 Jul 2013

Hello. I'm trying to execute the simplest example for Pattern recognition network, given in this link http://www.mathworks.fr/fr/help/nnet/ref/patternnet.html for iris flowers classification.

[x,t] = iris_dataset; net = patternnet(10) net = train(net,x,t); view(net) y = net(x); perf = perform(net,t,y) classes = vec2ind(y)

**Error using struct
Conversion to struct from double is not possible.**

And it's the same error if I use the Neural Network interface. Can anyone help me, please? Thank you very much!

*No products are associated with this question.*

Answer by Greg Heath
on 28 Jul 2013

Accepted answer

I cut and pasted your code. It ran with no problem or messages.

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 3 Comments

## Jan Simon (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/83355#comment_161891

Please be so kind and post the complete error message. Most of all show us the line, which causes the error and explain the type of the used variables.

## ML guy (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/83355#comment_220214

When I cut and paste his code (on a mac running R2014a and MacOS 10.9.3), I get this error:

## ML guy (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/83355#comment_220217

I discovered that the cause of my replication of your error was the fact that I had redefined the 'softmax' function in my MATLAB workspace. There are a number of functions that would cause this error if you redefine them, such as: netsum purelin tansig dividerand mse adaptwb learngdm crossentropy softmax