To extract 10 values at equal interval from 170*390 table

2 Ansichten (letzte 30 Tage)
Shaheer Ansari
Shaheer Ansari am 23 Sep. 2020
Kommentiert: Shaheer Ansari am 24 Sep. 2020
I am working on prediction methods and wish to extract only 10 sample from every row . The table consists of voltage parameters at various cycles. The number of total cycle is 168 with different length are assigned in column whereas voltage measured in row.
Regards

Antworten (1)

Image Analyst
Image Analyst am 24 Sep. 2020
[rows, columns] = size(voltage) % Get size of voltage matrix. Should be 170 rows by 390 columns
columns = round(linspace(1, columns, 10)) % Get 10 columns even spaced from 1 to the right column, rounded to integers of course in case they're not)
% Should be 1 44 87 131 174 217 260 304 347 390 -- that's 10 columns evenly spaced.
output = voltage(:, columns); % Extract only those 10 columns. output is 170-by-10

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by