solve a issue regarding saving a variable to mat file.

I am doing project on Automated Detection of Arryhthmias .As initial process I need a ECG signal, for that I downloaded rddata.m and ECG recordings of MIT database. For further processing I need only channel 1 or channel 2 output .So, now need to save channel 1 signal ,For that I wrote below lines at the end of rddata.m
ecg1=M(:,1); % channel 1 output
save ecg1
Running radata.m after above modification it give this error
_ *Error using save Unable to write file ecgta1: permission denied.
Error in rddata3 (line 165) save ecgta1;* _
can anyone please help me to solve this issue.
Thanks in advance

 採用された回答

Star Strider
Star Strider 2014 年 9 月 25 日

1 投票

The save call as you wrote it will all your current workspace variables to your file.
To save only your ‘ecg1’ variable to a .mat file named ‘ecg1.mat’, you have to define that specifically. See if this works:
save('ecg1.mat', 'ecg1')
(I did not test this code, but it should work.)

2 件のコメント

sarika
sarika 2014 年 9 月 26 日
編集済み: sarika 2014 年 9 月 26 日
Thanks a lot for your quick response sir.
I changed the code as you mentioned . Now it works.
Star Strider
Star Strider 2014 年 9 月 26 日
My pleasure!
If you have other problems, we’re here to help.

サインインしてコメントする。

その他の回答 (1 件)

Michael Haderlein
Michael Haderlein 2014 年 9 月 25 日

1 投票

This error (Error using save Unable to write file ecgta1: permission denied.) says that you don't have writing permission at the directory you have chosen. As you haven't specified the directory, it will save the file just in the current directory which puzzles me a bit. Usually you do have access there. Can you please post here what
pwd
returns?

1 件のコメント

sarika
sarika 2014 年 9 月 26 日
Thanks a lot for your valuable suggestions
U found out a correct mistake.I saved that file in other directory, Now it works correctly.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeApplications についてさらに検索

質問済み:

2014 年 9 月 25 日

コメント済み:

2014 年 9 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by