Effacer les filtres
Effacer les filtres

How can I break a long column vector (281820X1) into 140 short column vectors (2013X1)?

3 vues (au cours des 30 derniers jours)
I collected the raw data from a Raman image which acquired 140 Raman spectra from a 14X10 rectangular area. The resulting data file contains 281820 rows for all the spectra so how should I restore the 140 individual data files?

Réponse acceptée

Les Beckham
Les Beckham le 15 Déc 2023
Modifié(e) : Les Beckham le 15 Déc 2023
data = (1:281820)';
cols = 140;
rows = numel(data) / cols;
data_reshaped = reshape(data, [rows cols]);
whos
Name Size Bytes Class Attributes cmdout 1x33 66 char cols 1x1 8 double data 281820x1 2254560 double data_reshaped 2013x140 2254560 double rows 1x1 8 double
Also, if you are just getting started with Matlab, I would highly recommend that you take a couple of hours to go through the free online tutorial: Matlab Onramp
  4 commentaires
Xuyang He
Xuyang He le 15 Déc 2023
Sure, sorry for the delayed response.
Les Beckham
Les Beckham le 15 Déc 2023
You are quite welcome. Thanks for accepting the answer.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by