Effacer les filtres
Effacer les filtres

Hi, I am working on a set of code implying the ANN. My end purpose is to plot a comparison graph between actual output and simulated output. However, there isn't any points displayed in my plot. What is the correct syntax?

2 vues (au cours des 30 derniers jours)
A=data(:,2)
R1=data(:,5)
TA=A' % Transpose the Input and Output data from column to row matrix
TR1=R1'
[NA,PS]=mapminmax(TA) %Normalize the transposed input and output data
[NR1,TS]=mapminmax(TR1)
for i=1:20;
net = feedforwardnet(i,'trainlm');
net.trainParam.show = 50;
net.trainParam.lr = 0.05;
net.trainParam.epochs = 300;
net.trainParam.goal = 1e-5;
[net,tr] = train(net,NA,NR1);
[trainInd,valInd,testInd] = dividerand(20,0.7,0.15,0.15); %Divide data randomly
Y=sim(net,NA)
TY=mapminmax('reverse',Y,TS); %Denormalize simulated data
plot(i,TR1,'red',i,TY,'blue') % Plot comparison graph of experimental output data and simulated data
title('Graph of Comparison between Experimental Output Data and Simulated Data')
xlabel('Experimental Input Data')
ylabel('Experimental Output Data and Simulated Data')
legend('Experimental Output Data','Simulated Data')
end
  1 commentaire
Greg Heath
Greg Heath le 21 Déc 2018
The dividerand statement makes no sense.
  1. It is not used for training
  2. .If it were used it would yield a random mixture of trn, val and tst data
OR am I missing something ?
Greg

Connectez-vous pour commenter.

Réponse acceptée

madhan ravi
madhan ravi le 18 Déc 2018
Modifié(e) : madhan ravi le 18 Déc 2018
However, there isn't any points displayed in my plot. What is the correct syntax?
plot(i,TR1,'-or',i,TY,'-ob') % add 'o' as marker to view the data points
  2 commentaires
Shay Ang
Shay Ang le 21 Déc 2018
Thank you for the help. My plot is showing now, however, the points are all accumulated at the 20th x value only. How do i make the points plotted on each x value? (from 1 to 20)
madhan ravi
madhan ravi le 21 Déc 2018
save every variable in each iteration and plot them outside the loop ,
P.S - I don't have neural network toolbox so I cannot test.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Sequence and Numeric Feature Data Workflows dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by