EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: Karamel on April 07, 2018, 05:50:31 pm

Title: .mat file to csv conversion
Post by: Karamel on April 07, 2018, 05:50:31 pm
Hi,

I am trying to convert .mat file to csv on Matlab. It is very simple but I am getting an error csvwrite command.

Mycodes,

Code: [Select]
y = load('data.mat');
csvwrite('test.csv', y);

csvwrite line gives this error : Error using csvwrite (line 2) Undefined function 'real' for input arguments of type 'struct'.

However, my .mat file have no any problem. Each cells has a variable which are real number.

Why does Matlab give this error?
Title: Re: .mat file to csv conversion
Post by: Karamel on April 07, 2018, 06:04:08 pm
I loaded manually (with clicking data.mat) file to workspace. After that, immediately, problem has been solved.  :palm: