Import Text Data As a Numeric Matrix with Specific Delimiters

7 次查看(过去 30 天)
I need to import a text file as a Numeric Matrix, I have been using the "Import Data" then using Semicolon (;) and a custom delimiter (=) but obviously is time consuming, is there any other way to import the data in a faster and easier way?
An example of the text file is attached and a picture of what I'm trying to get if it helps.
Thanks in advance!!
Picture.png

采纳的回答

Erivelton Gualter
I am not sure about older versions of Matlab, but for R2018b you can import data by clicking with the right button in the mouse and then press import data. Additionally, you can genereta a script using this functionallity.
You might check the following image.
import.PNG
Also, I am attaching the generated script.
Make sure to change the file name in the line 12. It must be the full path.
filename = 'C:\Users\Erivelton\Documents\MATLAB\ANSWERS\200 61067191 test.txt';
  1 个评论
Mauricio Amaya
Mauricio Amaya 2019-5-3
This is great Thank you!
It did work! (Also I recently updated my Matlab and I'm pretty sure the generate scrip option wasn't there).
Your scrip also works perfectly with the following functions I had so thats perfect.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by