数组索引问题。
    6 views (last 30 days)
  
       Show older comments
    
clear all;
N = 20;
for i = 1 :N
    A{i} = rand(5)
end
whos A
for j = 1:4
    if j ==2|j== 4
        B{j} = [A{5j};A{5j-1};A{5j-2};A{5j-3};A{5j-4}]
    elseif j == 1|j ==3
        B{j} = [A{5j-4};A{5j-3};A{5j-2};A{5j-1};A{5j}]
    end
end
[size=13.3333px]出错 test (第 12 行)        B{j} = [A{5j-4};A{5j-3};A{5j-2};A{5j-1};A{5j}]
[size=13.3333px]这里显示12行索引错了,但是我算了一下索引是大于0的整数啊
0 Comments
Accepted Answer
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
