Can you help me with xlswrite?
2 次查看(过去 30 天)
显示 更早的评论
>> n=10;
for k=1:n;
exp_tmp=['DNA',num2str(k),'=randseq(20);'];
eval(exp_tmp);
xlswrite('C:\Users\BFSL\Desktop\1.xlsx',[strcat('DNA',num2str(k))],strcat('A',num2str(k),:,'B',num2str(k)));
end
I want to make...
1. generate random DNA -> 2. save in excel like this(image below);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161379/image.png)
but reality is... (below)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161380/image.png)
can someone help me?
+generating is success
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/161381/image.png)
0 个评论
采纳的回答
KSSV
2017-3-6
编辑:KSSV
2017-3-6
clc; clear all ;
n=10;
exp_tmp = cell(n,2) ;
for k=1:n;
% exp_tmp{k}=['DNA',num2str(k),'=randseq(20);'];
% exp_tmp{k}=['DNA',num2str(k),' generated sequence',num2str(k)] ;
exp_tmp{k}=['DNA',num2str(k),' ',randseq(20)] ;
% eval(exp_tmp);
% xlswrite('C:\Users\BFSL\Desktop\1.xlsx',[strcat('DNA',num2str(k))],strcat('A',num2str(k),:,'B',num2str(k)));
end
xlswrite('DB.xls',exp_tmp) ;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!