How to assign a variable name to a cell in a for loop?
Mostra commenti meno recenti
I currently have a function that iterates through a data set and removes certain values into an excel file. I want to put all my data in at once (multiple individual tests) and separate out each test data.
I have a cell array named definedsubjects which I want to add into a for loop to take out individual columns, like this:
for i = definedsubjects
cols = i{:, a};
I want to use the cols variable to individually extract columns. However, when I use a 4x2 array for definedsubjects, i becomes a 4x1 array, only accessing the first column of data.
Any advice on how to fix this would be appreciated!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!