how to write a loop to read two columns for a matrix each time
Show older comments
Hi fellows, I have a matrix called tt (50*40) and I need to read two columns from it each time. And this is my code
if true
% for i=1:20
subdata=tt(:,2i-1:2i);
end
end
but in this way I get the error message is "Subscript indices must either be real positive integers or logicals." Any one know how to solve it? Or do you have another way to read the data as I want?
Cheers
Accepted Answer
More Answers (1)
xueqi
on 25 May 2013
0 votes
Categories
Find more on MATLAB Report Generator 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!