Why did the matrix symbol become 10x10?

1 view (last 30 days)
>> 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

Accepted Answer

madhan ravi
madhan ravi on 19 Nov 2018
Edited: madhan ravi on 19 Nov 2018
symbol= zeros(length(mat)-1,length(mat),2); %changed this line

More Answers (0)

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!