MATLAB Answers

Reading Workspace variable into csv file

18 views (last 30 days)
Mehul Jain
Mehul Jain on 2 Apr 2020
Commented: Mehul Jain on 6 Apr 2020
I got above 22 side bands output from 3D DWT, which are represented in the form of matrix. I need to read this into the csv file. Can anyone help me out???
  6 Comments
Mehul Jain
Mehul Jain on 2 Apr 2020
Yes, another program requires in 17x323 format.

Sign in to comment.

Accepted Answer

Rik
Rik on 2 Apr 2020
The most important thing to do first is to reshape the data to a 2D array. Then we can use the writematrix function as normal.
WT.dec{1,1}=rand(17,19,17);%generate random data
d=WT.dec{1, 1};%store in other variable for shorter syntax
%option 1: 17x323
d1=reshape(d,size(d,1),[]);
%option 2: 289x19
d2=mat2cell(d,size(d,1),size(d,2),ones(1,size(d,3)));
d2=cell2mat(d2(:));
filename='d1.csv';
writematrix(d1,filename)
  8 Comments
Mehul Jain
Mehul Jain on 6 Apr 2020
Machine learning classifier program.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by