???index exceeds matrix dimensions
Show older comments
in my program i have used for loop and if loop at the end i am getting ???index exceeds matrix dimensions this comment after calculating 1 value, where i have to calculate 42 values i used
example
for x=1:42
if x==1
a=1;
b=2;
end
if x==2
a=2;
b=3;
end
:
:
:
:
:
:
if x==42
a=42;
b=43;
end
c=a+b
end
1 Comment
Walter Roberson
on 8 Dec 2011
There is no such thing as an if loop.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing 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!