How to use a function like reshape but for indivisible parameters?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to compare two different sets of data containing ozone concentrations, one set I have collected, the other set has been collected by a third party. I have 64 data points and the third party has 12. How can I use a function like reshape to account for the data sets being indivisible between each other?
Flight1O3 = Aug2Flight1.O3_ppb(:); % the column with 64 data entries
Alt_O3 = reshape(Flight1O3, [], 12); % trying to reshape the 64 into 12
0 comentarios
Respuestas (1)
Voss
el 4 de Jun. de 2024
You'll have to put some additional elements in the vector for the reshape operation to work:
A = rand(68,1);
N = ceil(numel(A)/12)*12; % next multiple of 12
A(end+1:N) = NaN; % extend A with NaNs to size N
A_new = reshape(A,[],12);
disp(A_new)
A = resize(A,N,'FillValue',NaN); % extend A with NaNs to size N
A_new = reshape(A,[],12);
disp(A_new)
0 comentarios
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!