Dear All,
I have a file ".txt" and I want to save it to ".mat". I used this code and got this error.Please see below.
data=dlmread('RO-2013-equinox.txt');
>> save ('RO-2013-equinox.mat',data);
Error using save
Must be a string scalar or character vector.
I would appriciate to help me.

2 commentaires

Stephen23
Stephen23 le 25 Août 2022
save('RO-2013-equinox.mat','data')
% ^ ^ this needs to be the name of a variable
Ara
Ara le 25 Août 2022
Modifié(e) : Ara le 25 Août 2022
Thank you. I wish you write in answer so that I can accept it and vote to you.

Connectez-vous pour commenter.

 Réponse acceptée

Chunru
Chunru le 25 Août 2022

1 vote

data=dlmread('RO-2013-equinox.txt');
save('RO-2013-equinox.mat', 'data'); % quote the variable name

Plus de réponses (0)

Catégories

En savoir plus sur Scope Variables and Generate Names dans Centre d'aide et File Exchange

Tags

Question posée :

Ara
le 25 Août 2022

Modifié(e) :

Ara
le 25 Août 2022

Community Treasure Hunt

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

Start Hunting!

Translated by