How to import .par file

58 次查看(过去 30 天)
Sai Gudlur
Sai Gudlur 2023-8-21
编辑: Sai Gudlur 2023-8-22
Hello,
I am trying to import .PAR an output of Vector Canape (Software used in Automotive Calibration).
If I use Import Data under Home I am able to import data as MATLAB when I use the same after UIgetfile it wouldn't get all the rows of data. have used delimiters options as well.
Also tried importing using detectimportsoptions with filetypes and delimiters still cannot get all data into the workspace.
I have attached screenshots of them. Capture (is when using import data button under home). Capture_1 is when using code.
Forum isn't allowing me to add the file as the format is not supported.
Any help/suggestion is appreciated.
Thank you
[filename,pathname]= uigetfile({'*.*','All Files (*.*)'});
Fullfilename_1 = importdata(fullfile(pathname,filename));
  4 个评论
dpb
dpb 2023-8-22
Use @doc:readcell; the form isn't conducive to other forms.
Then you'll have to parse it to return the variables, descriptions and data on a line-by-line basis.
The input form is also bizarre in that there are variables with indicated types "[FLOAT}" , "[UINT8]", etc., with a value and then ";" and another value, are both values significant? More often than not (but not always), the two values are the same.
Then, there are what appear to be arrays with a size argument
C_Diag_CluPositionInstantDM [UINT(32),(1,2)]
: 0 ; 0
: 1024 ; 1024
but the number of data elements doesn't match the descriptor. Whassup with that???
Going to need quite a lot of explanation of what are looking at and what, specifically, it is that are trying to import and how you think you've going to use this in MATLAB.
Sai Gudlur
Sai Gudlur 2023-8-22
编辑:Sai Gudlur 2023-8-22
Hello dpb & Stephen23,
I used the below code and it worked. I wasn't sure, pretty much wanted to try every option availble and this worked in my favor. Thank you everyone. Also attached screenshot of the data types how it extracted.
A=readtable("C:\Users\gudlu\OneDrive\Documents\Matlab\NGHD_E336.e006.p000_Navistar_X15_ModeAB_12Spd_C3_1_Modified.par","FileType","text");
B = A.Var1(5:end,:);
C = A.Var2(5:end,:);

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by