Undefined function or variable 'Data'.
조회 수: 1 (최근 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?
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 String Parsing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!