How to split data into cell
Mostra commenti meno recenti
In the given excel I have 4 columns I want to split the data with respect to column 1 name as minutes and save the data of the other corresponding columns name with D1, D2, D3.
the condition should be that the data start from zero in column 1 and select the data upto next zero occure. save this data in one cell and again start saving data start from the next zero upto another zero occure.
7 Commenti
Rik
il 27 Ott 2021
A naive approach would be to do this with a loop row by row. When you have working code with a loop it will be likely be easy to speed this up (e.g. with something like find(data>0,1,'first')).
What did you try?
Adil Sardar
il 27 Ott 2021
Modificato: Rik
il 27 Ott 2021
Rik
il 27 Ott 2021
Write it out: what should happen when? What should be done for each row?
If the value of minute is 0, start a new cell and make that the current cell. If not, stay in the current cell.
Then add the value of your data to the current cell.
How would you write this in code? Also, please use the layout options of the editor.
Adil Sardar
il 27 Ott 2021
Adil Sardar
il 27 Ott 2021
Adil Sardar
il 27 Ott 2021
Rik
il 27 Ott 2021
I understand what you want, now I want to see if you can translate the text I wrote to code. Think of what should happen step by step. Can you understand why the code you posted didn't work?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spreadsheets in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
