Why did the matrix symbol become 10x10?

1 次查看(过去 30 天)
>> format long
mat = [ 0.7188 0.0625 0.0625 0.0469 0.0313 0.0156 0.0156 0.0156 0.0156 0.0156 ];
index = find(ismember(mat,min(mat)));
b = index(end-1:end);
symbol= zeros(length(mat),(length(mat)-1),2);
for b1 = 1:length(b)
symbol((length(mat)-1),b(b1),2)=1;
end
The result is
symbol(:,:,2) =
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 0 0
I have declare 9 x 10 matrix but the above matrix shows 10x10

采纳的回答

madhan ravi
madhan ravi 2018-11-19
编辑:madhan ravi 2018-11-19
symbol= zeros(length(mat)-1,length(mat),2); %changed this line

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by