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!