Undefined function or variable 'Data'.

4 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2020-10-6
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()

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

标签

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by