What does this error mean?
1 view (last 30 days)
Show older comments
I keep getting an error saying that there is an "Unbalanced or unexpected parenthesis or bracket." This is the line I keep getting error on. What am I doing wrong?
for data(:,1:end)
0 Comments
Accepted Answer
Geoff Hayes
on 9 Nov 2014
The problem is the code is incorrectly defined for a for loop. If the intent is to iterate through each element of data(:,1:end), then your code should be written as
numRows = size(data,1);
for k=1:numRows
% get the kth row of data
rowData = data(k,:);
% do something with the row data
end
If that is not the intent of the code, then please describe what you are trying to do.
More Answers (0)
See Also
Categories
Find more on Data Type Conversion 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!