MATLAB: calculate with first row n times before moving to the next number - matlab

I am pretty new to Matlab and I could use some help. I have about 50k rows of data. What I would like to do is, that it would take the first number of the data, divide it by 12 and repeat the result 12 times then it would move on to the second number and do the same and so on and on till the end.
Best regards

Related

How to change from one case to another (many to many make it many to one) using lstm in Matlab?

I have a matrix of 140 rows with 5 columns. Every 5 values in the row represents the input. The target for every row is variables. How can I make it many to one or many to one in Matlab?

Excel formula less than equal to 10 minute average for column

I have a range of approximately 1800 time increments (HH:MM:SS) in one column, sorted from low to high.
I am trying to come up with a formula that will produce the percentage of cells that are equal to or less than 10 minutes (10:00:00) of the approximately 1800 cells.
I'm not sure if I should be using AVERAGEIFS or another formula.
Thank you.
Some vagueness in the question. Is the time absolute and you want to compare among them or relative to a specified time. For the first case, you may very well use countif.
To get the cells less than equal to 10minutes:
countif(range,"<00:10:01")
Based on the comment, you can use this single formula:
=(COUNTIF(range,"<00:10:01")*100)/COUNTA(range)
The counta function gives you the number of non-blank cells in a range.

Segment raw time series into chunks

I have written code in Matlab to read data from CSV file and store it in an array the file contain many rows and 4 main columns (time, x,y,z). the time is then divided into segments of 10 seconds. i have calculated the start and finish time for each segment, now I want to get the x,y,and z-data into each segment. can you guys help me please?

Find time stamps in a given time interval (start/end) in a 2 column matrix

MatLAB noob here..
I have a 2 column matrix with start/end (in seconds) times - in a 2 column matrix.
I also have a single column matrix of time stamps. How do I find the time stamps that occur in each interval?
Not going to put any code here, as you provided none.
There are some alternatives, this is the most straight forward (though might not be the most efficient for the computer):
Use a for loop, for each line of your start/end matrix, and for each do another for loop for each element in your time stamp matrix, and assess, using if function, if each time stamp is between start and end times.
If you don't know how to use FOR and IF, type help FOR, help IF and find out. Or google it

Calculate time of script execution previously with Matlab

Good morning,
I have a question about the time execution of a script on Matlab. Is it possible to know previously how long spend the execution of a script before running it (an estimated time, for example)? I know that with tic and toc command, among others, is it possible to know the time at the end but I don't know if it's possible to know it before.
Thanks in advance,
It is not too hard to make an estimate of how long your calculation will take.
You already know how to record calculation times with tic and toc, so now you can do this:
Start with a small scale test (example, n=1) and record the calculation time
Multiply n with a constant k (I usually choose 2 or 10 for easy calculations), record the calculation time
Keep multiplying with n untill you find a consistent relation: 'If I multiply my input size with k, my calculation time changes like so ...'
Now you can extrapolate your estimated calculation time by:
calculating how many times you need to multiply input size of the biggest small scale example to get your real data size
Applying the consistent relation that you found exactly that many times to the calculation time of your biggest small scale example
Of course this combines well with some common sense, like if you do certain things t times they will take about t times as long. This can easily be used when you have to perform a certain calculation a million times. Just interrupt the loop after a minute or so, if it is still in the first ten calculations you may want to give up!