split column vector into sub-columns and rename
Mostra commenti meno recenti
i have 24360 rows by 1 column vector and i want to split or chop it into 1015 rows by 1 column vector and save them (that would give me 24 of the 1015x1 vector ) which i would either live to save separately as single 1015by1 column vectors or single 1015by24 file
ideally i would want the output to look like the output of the code below
mat=zeros(24,1015)
for k=1:24
vec=[3:1017]+k
mat(k,:)=vec
end
mat;
dlmwrite('mat.txt',mat,'delimiter',' ');
% similar to the above structure this is what i wrote :
load 'random24at31050.txt'; % input file google drive link is :
% https://drive.google.com/a/columbia.edu/file/d/0B_AwZrt6f2FzUS1nUWQzZEhVZFE/view?usp=sharing
intensity= random24at31050(:,4);% copy 4th column of input file ,this single column has 24360 rows
collect_ramanintensity=zeros(1015,24)
for k =1:24
ramanintensity=intensity((k*1015-(k*1015)+1):k*1015,:);
collect_ramanintensity(1:length(ramanintensity),k)=ramanintensity% collect_ramanintensity(:,k) isnt working
end
collect_ramanintensity;
dlmwrite('collect_ramanintensity.txt',collect_ramanintensity,'delimiter',' ');
This is not coming out as the 1015by24 matrix I expected I would appreciate any suggestions ....I am open to
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su File Operations 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!