Effacer les filtres
Effacer les filtres

How can I save the output of a for loop onto the same column, when each iteration gives me an answer of different heights?

2 vues (au cours des 30 derniers jours)
Hi!
I'm trying to save the output of my data onto one single column. After each iteration I get a column of answers that are at different heights.
My goal is to save each P_mask result into one single column named fin_mask. Each answer (P_mask) is a different height. Ranging from 800 to 70. I've tried this
parcel_vals = [1,4,6,25,26,44,94,114,116,117]
num_pv = length(parcel_vals);
for node = 1 : num_pv
P = parcel_vals(node) ;
P_mask=find(gordon_atlas==P);
fin_mask(node) = P_mask;
end
This does not work. Does anyone know how to resolve this?
Kindly,
K

Réponses (1)

Jeffrey Clark
Jeffrey Clark le 21 Avr 2022
Store the itteration results in a cell array (not the default doubly type array you are using); see Cell array - MATLAB (mathworks.com)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by