reading values
Show older comments
I have some data ,i tried using xlsread ,but final column is not dsiplaying
A=
12 36 45 858 8 1 >50
10 2 1 21 20 0 <=50
like these i have 30000 rows and 6 columns,now i want to read all the column and store the last column in separate variable,please help
1 Comment
Image Analyst
on 25 Jan 2012
What is that? That is not MATLAB code.
Answers (2)
Image Analyst
on 25 Jan 2012
How about this:
separateVariable = array2D(:,end);
4 Comments
kash
on 25 Jan 2012
Image Analyst
on 25 Jan 2012
That's your array of 30000 rows and 6 columns. Obviously it might not be called array2D - your actual 2D array in your program may have a different name, right? What is the name of it? Let's say you called it M, and let's say you want the separate variable to be called lastColumn instead of separateVariable. Then you'd simply replace array3D in my code with M, and separateVariable in my code with lastColumn, like this:
lastColumn = M(:, end);
Hopefully that's explicit enough to help explain it in a different way - a way that you can understand. If you still don't understand then say so and post your code. But you still didn't explain what this means:
10 2 1 21 20 0 <=50
kash
on 25 Jan 2012
Image Analyst
on 25 Jan 2012
Do what I said then. The to get the sum of the number of elements where the value <= 50:
summedUp = sum(lastColumn<=50);
Walter Roberson
on 25 Jan 2012
0 votes
How did you do the xlsread() ? That final column is going to be discarded (or 0 or NaN) in the (default) numeric output, available only in the second (text) output or third (raw) output.
Categories
Find more on Low-Level File I/O 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!