Loaded variable can't be indexed, unrecognized function or variable error
이전 댓글 표시
I am attempting to pull a specific index from data loaded into a file. Here's the code in question:
load 'aes_power_data.mat';
n_traces = 200;
traces = traces (1:n_traces, :);
plaintext = plain_text (1:n_traces, :);
...
function [result] = predict_Sbox(key, p_Text, byte)
PT = plaintext(p_Text, byte);
pos = bitxor(key,PT);
result = sbox(pos);
end
Load places a 200x16 double into the workspace, but the line "PT = plaintext(p_Text, byte);" is when the error occurs. So the first time I call this, it should pull the first value from plaintext (1,16). What am I doing incorrectly? Is the error in catching the variable or in my use of function or something else?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!