How to output function results over split columns
Afficher commentaires plus anciens
I have a loop which contains a function that produces results to a different sheet of a matrix. I would like to insert an additional column of information after the function has been completed, but I am not sure how to index the function output to allow for this. Ideally, I would like to collect the output information into a split set of columns so my inserted column is in the middle, but I either receive a 'Subscripted assignment dimension mismatch' or 'Undefined function or variable 'output'' error (depending on if I initialize with a blank array or not).
for i = 1:N;
output(:,[1:4,6:end],i+1) = processFiles(input);
output(:,5,i+1) = output(:,4,i+1)./output(:,2,i+1);
end
Does anybody have a suggestion on how to go about doing this type of insertion?
(Before you ask, no, I cannot provide a sample of 'input' or the 'processFiles' function)
Thanks
3 commentaires
TADA
le 24 Jan 2019
Set The Output Of processFiles Into A Matrix Regularly, Then Concat All Three Parts Of The Data Into Your Output Matrix
Bob Thompson
le 24 Jan 2019
TADA
le 24 Jan 2019
I'm Not Sure If It's Possible Or Not, I Never Tried This Type Of Indexing. But I Beg To Differ About "Simplicity's Sake".
The Complex Indexing Seems Less Clear Than Doing It With The Intermediate
Think About The Next Person Reading Your Code, or Yourself Reading It A Year From Today.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!