is this a bug of MATLAB?

clc;clear;close all;
i=0;j=0;
for isigmain=0:0.05:0.9
i=i+1;j=i;
for isigmaout=(isigmain+0.05):0.05:0.95
abc(i,j)=isigmain;
j=j+1;
end
end
Here is an easy code, I want to get a matrix named abc with size of 19 by 19. But when I run it. The abc is always 18 by 19. Because when isigmain==0.9, '(isigmain+0.05):0.05:0.95' always returns 'Empty matrix: 1-by-0' to isigmaout. Can anybody point out what is the problem?
my version is 7.10.0.499(R2010a),

Answers (1)

Walter Roberson
Walter Roberson on 18 Dec 2012

0 votes

1 Comment

Thank you! I agree with that answer. When I change the cyclic variable to integers, results are correct.

Sign in to comment.

Categories

Tags

Asked:

on 18 Dec 2012

Community Treasure Hunt

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

Start Hunting!