Is it possible to open .mot file adjust it and export it as .mot file again?

Hi all,
I would like to adjust the content in my .mot file, since I need to subtract certain values. I am able to open my .mot file in Matlab and I can adjust the content. However, I don't know how to save the file as a .mot file again.
Is there by any chance someone who could help me?
Thank you for any advice.

5 Commenti

Yes! And I need to subtract values from one mot file from another mot file
It looks like pure text, so you can fopen() with 'w' and fprintf() to the file and fclose()
It is not pure text I think, is it? I am trying to use the fopen and fprinf now, but when I close it I get an empty file. How do I get the data matrix and text in the files? When I import the data I have a textdata array and a data matrix.
this is what I have written, but it doesnt work.
workfile1=importdata('C401_FP1.mot');
static1=importdata('C4statFP1.mot');
workfile3=importdata('C401_FP3.mot');
static3=importdata('C4statFP3.mot');
workfile2=importdata('C401_FP2.mot');
static2=importdata('C4statFP2.mot');
for i=2:10
if i==5:7
continue
end
z=workfile1.data(:,i)-static1.data(1,i);
workfile1.data(:,i)=z;
y=workfile3.data(:,i)-static3.data(1,i);
workfile3.data(:,i)=y;
s=workfile2.data(:,i)-static2.data(1,i);
workfile2.data(:,i)=s;
end
wf1 = fopen('C401_FP1.mot','w');
fprintf(wf1, workfile2.textdata, workfile2.data);
fclose(wf1)
When you use fprintf with the first parameter being a file identifier then the second parameter must be a format. Parameters after that are data to be processed by the format.
fprintf is not equivalent to disp() of each parameter but sent to the file.
You will probably need one fprintf for the textdata and another for the numeric values.
Also if the numeric data is a 2d array you will probably need to transpose it. MATLAB goes down columns.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Centro assistenza e File Exchange

Richiesto:

il 24 Lug 2020

Commentato:

il 24 Lug 2020

Community Treasure Hunt

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

Start Hunting!

Translated by