Undefined function or variable 'Data'.

3 vues (au cours des 30 derniers jours)
Daffa Muhammad Fadhil
Daffa Muhammad Fadhil le 6 Oct 2020
clc, clear, close all;
% load jaringan yang sudah dibuat pada proses pelatihan
load net.mat
% Proses membaca data uji dari excel
filename = 'CurahHujan.xlsx';
sheet = 2;
xlRange = 'D25:P36';
data_uji = Data(:,1:12)'; %<------------
target_uji = Data(:,13)';
[m,n] = size(data_uji);
% Hasil prediksi
hasil_uji = sim(net_keluaran,data_uji);
nilai_error = hasil_uji-target_uji;
max_data = 450;
min_data = 58;
hasil_uji = ((hasil_uji-0.1)*(max_data-min_data)/0.8)+min_data;
% Performansi hasil prediksi
error_MSE = (1/n)*sum(nilai_error.^2);
filename = 'CurahHujan.xlsx';
sheet = 1;
xlRange = 'E11:P11';
target_uji_asli = xlsread(filename, sheet, xlRange);
figure,
plot(hasil_uji,'bo-')
hold on
plot(target_uji_asli,'ro-')
hold off
grid on
title(strcat(['Grafik Keluaran JST vs Target dengan nilai MSE = ',...
num2str(error_MSE)]))
xlabel('Pola ke-')
ylabel('Curah Hujan (mm)')
legend('Keluaran JST','Target','Location','Best')
can someone solve this?

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Oct 2020
You
load net.mat
but that file does not happen to contain a variable named Data
filename = 'CurahHujan.xlsx';
sheet = 2;
xlRange = 'D25:P36';
You define information about some data in an xlsx file, but you never read from the file.
By the way: these days we recommend readtable() or readmatrix() or readcell() instead of xlsread()

Plus de réponses (0)

Tags

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by