How to loop through all the rows of size using a for loop

1 visualización (últimos 30 días)
Ralph
Ralph el 13 de Sept. de 2020
while hasdata(ADS)
x = read(ADS);
%[x,Fs]=audioread('C:\Users\vvb\Documents\New\pan.wav');
sname='Sheet1';
startingColumn='A';
filename = 'C:\Users\vvb\Documents\local.xlsx';
% if P=8, it means 8 neighbours and 1 reference sample. total frame size
% will be 9 in this case
% x=x1(1:27,1);
thresh = 0.0003;
P=8; % no of neighbours for computation
% thresh=0.01; % in future take this value in INPUT
b_right=zeros(1,4); % variables for computing differnces on sides
b_left=b_right;
[row,c]=size(x); % total number of samples is "row"
total_frames=row/9;% number of total frames as 1 Frames=9 samples
% so total frames = total samples/ frame size
% full_frame=zeros(9,500);
k=1;
i=5;
aa=rem(row,P+1); % in this case P+1=9;
last_index=row-aa;
Here I want to create a for loop that will go from 1 to size of 'x'. In each iteration it will retrieve the values containing in size(x) one by one and store in a variable name 'check' from 1 to size x. What I mean to say is that every value of the row from the size(x) function will be retrived and store in the check function. for example first value of row is retrived and stored in check function. next time the loop will check for second value and so on.
for ii=1:size(x)
Numberofrows(ii)=ii;
check=Numberofrows;
end
I have written this code for it but its not retrieving any values of x.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by