Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Array from text file

3 Ansichten (letzte 30 Tage)
Ines Domingos
Ines Domingos am 19 Jan. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hi! I have a text file that look like the image attached. I need to do an array with all the values between the [ ]. How can I do that?
Many thanks!
  1 Kommentar
Akira Agata
Akira Agata am 20 Jan. 2018
Could you upload (or copy&paste) this first 3 lines of your data as a text? That would be helpful for everyone here to find better solution.

Antworten (1)

Pawel Jastrzebski
Pawel Jastrzebski am 19 Jan. 2018
You can use Matlab import function and then change the import setting to what you need:
  1. Select output format
  2. Add Data to your workspace
Or import data using commands, i.e.:
From what I see your data is all numeric so most likely you're going to import is as matrix. To convert matrix to the cell array use:
  1 Kommentar
Ines Domingos
Ines Domingos am 19 Jan. 2018
Hi! the problem is that I have more than 16000 lines with data.

Community Treasure Hunt

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

Start Hunting!

Translated by