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!