I'd like to ask you a question about making a CSV by conducting a matlab concert

Asked 2 years ago, Updated 2 years ago, 73 views

Let's set the data variable station = cell, header = char, data = double

station = {'st';,'qe';,'qr';}
header = ('where QE QR');
data =  [10 15;20 25;30 35;]

To tie it with data2, I made it into a cell type and tied it with data2.

ofn = 'set.csv';
ofid=fopen(ofn,'w');
hdr = header;
fmt = '%s %d %d\n';

data = num2cell(data);
data2 = [station data];

fprintf(ofid,'%s\n',hdr);
fprintf(ofid,fmt,data2{:});
fclose(ofid);

The result I was thinking of was this termination

That's how it was created.

How can I get the result like the picture I want? Please give me your help me

matlab csv

2022-09-20 15:07

1 Answers

I don't know about matlab

fmt = '%s,%d,%d\n';

I think it should be the ruling party.


2022-09-20 15:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.