SOS: xlswrite with cell array

Hello, I don't know why it doesn't work and how to correct it.
R1000_Co_ticker is a 135*2 cell array, which looks like:
R1000_Co_ticker =
'MCP' 'LZ'
'WLT' 'ARG'
'LYB' 'IFF'
'ANV' 'ECL'
'CF' 'BLL'
'MCP' 'LZ'
'WLT' 'ARG'
'LYB' 'ECL'
'ANV' 'IFF'
'CF' 'BLL'
'MCP' 'LZ'
'WLT' 'ECL'
'ANV' 'ARG'
'LYB' 'IFF'
'CF' 'BLL'
I am running [status,msg] = xlswrite('filename',R1000_Co_ticker(1:135,1),'Russell 1000','D4:D138');
But it doesn't work. Please help on my case, very appreciated!

 채택된 답변

Oleg Komarov
Oleg Komarov 2011년 7월 12일

1 개 추천

[status,msg] = xlswrite('myFile.xlsx',R1000_Co_ticker(1:135,1),'Russell 1000','D4:D138');
myFile.xlsx will be created in the current directory. If you want a specific location just include C:\...\myFile.xlsx where you have to replace the dots with your prefered location.

댓글 수: 7

Zoe Zhang
Zoe Zhang 2011년 7월 12일
But when I ran xlswrite('filename',R1000_IV(:,1),'Russell 1000','F4:F138'); it totally works, where R1000_IV(:,1) is a numeric vector. So I think may be there is sth wrong with the cell array?
Thanks for your help!
Fangjun Jiang
Fangjun Jiang 2011년 7월 12일
What is the error message?
Zoe Zhang
Zoe Zhang 2011년 7월 12일
[status,msg] = xlswrite('Global_IV_Report',R1000_Co_ticker(1:135,1),'Russell 1000','D4:D138')
status =
1
msg =
message: ''
identifier: ''
No error msg whatsoever, and failed to export the result into excel. Thanks!
Oleg Komarov
Oleg Komarov 2011년 7월 12일
Doesn't fail with me. Can you elaborate on the meaning of fail? (did you look in the right directory)
Zoe Zhang
Zoe Zhang 2011년 7월 12일
wierd,wierd,wierd...it works now... Thanks both of you!!
Fangjun Jiang
Fangjun Jiang 2011년 7월 12일
If status is 1, it means it is written successfully. You have to double check your current folder to find the file.
Zoe Zhang
Zoe Zhang 2011년 7월 12일
oic, thx!! :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by