Convertir archivos *.mat a *.m

12 views (last 30 days)
Edwin Cuevas
Edwin Cuevas on 28 Jul 2014
Edited: Image Analyst on 4 Aug 2014
Buenas. Si me pueden colaborar con un problema. Entrene redes neuronales con el NNTOOL de matlab y los guarde en el disco (se crean con extensión *.mat por defecto) y cuando abro la red entrenada en con el MathScript de Labview unos caracteres que nada que ver con la topología de la red entrenada. Viendo el editor de Matlab crea archivo *.m el cual puede leer sin ningún problema MathScript de Labview (lo muestra tal como está). Ahora mi consulta es como exporto la red neuronal entrenada para que pueda leer el MathScript o como puedo convertirlo en un archivo *.m.
Saludos

Answers (2)

Star Strider
Star Strider on 28 Jul 2014
Use the load function to read ‘.mat’ files.
  3 Comments
Star Strider
Star Strider on 3 Aug 2014
I am not able to find any information on exporting a neural net developed and trained in MATLAB to LabView. It seems you have to start over in LabView and design and train it there.
I don’t have LabView and have no experience with it. Your best option is likely to find a way to import LabView data into MATLAB and work with it in MATLAB.
Image Analyst
Image Analyst on 4 Aug 2014
All of Edwin's multiple "Answers" moved here:
Thanks for your answer, but need a way how to export a neural network in *.m file, because Labview only open this kind of file, I look for that information in Internet and I found some papers of people who exported the neural network trained in maltab to labview but they did not explain how to do it.
Thanks in advance
There is mistake, You think that I want to export data from Labview to Matlab?. What I want is to export a trained neural network from Matlab to Labview, but this is difficult because Matlab saves the neural network in a *.mat file and this kind of file can not read Labview. I am trying another way, once trained neural network in nntool I copy all weights W and bias b to excel and then with a network, but the results were not satisfactory.
Fot practice I train a neural network that simulates the sin and cos function.
x =-pi: 0.1: pi (data input)
y = sin (x)
t = cos (x)
s = [y, t] (target)
the neural net
5 input neurons, transfer function logsin
2 output neurons, function transfer purelim.
The data neural network trained.
iw{1,1}-Weght to layer 1 from input 1
[1.7633;
0.82804;
-1.8429;
1.7864;
-1.8507]
Iw {2,1}-Weght to layer
[-59.2248 172.0368 9.3009 -35.4942 30.9135;
32.2859 38,019 54,154 -54.8338 -47.2435]
b {1}-Bias to layer 1
[-1.7451;
-0.019407;
1.1473;
1.9413;
1378]
b {2}-Bias to layer 2
[-58.6646;
-6.2657]
I build a neural network with this data in excel, but the simulation outputs were not good, How I should build the neural network structure. In Matlab
the simulation data is good.

Sign in to comment.


Edwin Cuevas
Edwin Cuevas on 3 Aug 2014
Edited: Image Analyst on 4 Aug 2014
  1 Comment
Greg Heath
Greg Heath on 4 Aug 2014
Edwin,
Three times you have INCORRECTLY used the answer box for comments.
PLEASE, PLEASE, DO NOT DO THAT!
Use the comment box for comments.
I assume s = [ y, t ] jnstead of [ y ; t ] is a typo. Correct?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!