|
|
Convert decimal to Character
Hello, friends:
Anybody can help with this issue:
I am going to output around 1000 columns to Excel worksheet, But each Excel spreadsheet has only 256 columns, which are A-Z, AA-AZ, BA- BZ ... etc. I need to use xlswrite function to write to excel spreadsheet and automatically to change the column to next column. Is there any way to convert decimal to charcter in ordet to to change the column from A - A AA-AZ ...
Thanks
|
|
0
|
|
|
|
Reply
|
Shirley
|
1/20/2011 9:35:20 PM |
|
"Shirley Zheng" wrote in message <iha9qo$bec$1@fred.mathworks.com>...
>Is there any way to convert decimal to charcter
char(number)
|
|
0
|
|
|
|
Reply
|
Paulo
|
1/20/2011 9:59:07 PM
|
|
On 11-01-20 03:35 PM, Shirley Zheng wrote:
> Anybody can help with this issue:
>
> I am going to output around 1000 columns to Excel worksheet, But each Excel
> spreadsheet has only 256 columns, which are A-Z, AA-AZ, BA- BZ ... etc. I need
> to use xlswrite function to write to excel spreadsheet and automatically to
> change the column to next column. Is there any way to convert decimal to
> charcter in ordet to to change the column from A - A AA-AZ ...
The following version is vectorized, supporting a row or column vector of
column numbers in Col, and outputting a cell array of strings, one per column
number to be converted.
strtrim(cellstr(char(repmat(' A',length(Col),1) + [ floor((Col(:)-1)./26)
mod(Col(:)-1,26)] + [33.* (Col(:) > 26) zeros(length(Col),1)])))
The expression can be simplified if you are only working with one Col value at
a time.
|
|
0
|
|
|
|
Reply
|
Think
|
1/20/2011 10:03:30 PM
|
|
On Jan 21, 10:35=A0am, "Shirley Zheng" <zh...@ucalgary.ca> wrote:
> Hello, friends:
>
> Anybody can help with this issue:
>
> I am going to output around 1000 columns to Excel worksheet, But each Exc=
el spreadsheet has only 256 columns, which are A-Z, AA-AZ, BA- BZ ... etc. =
=A0I need to use xlswrite function to write to excel spreadsheet and automa=
tically to change the column to next column. =A0Is there any way to convert=
decimal to charcter in ordet to to change the column from A - A AA-AZ ...
>
> Thanks
There are many ways to skin a cat...............
I wouldn't do it the way you're planning.
What I'd do is collect all the columns you want to send to Excel into
a matrix and issue a single xlswrite. Then you wouldn't need to worry
about specifying the columns at all.
|
|
0
|
|
|
|
Reply
|
TideMan
|
1/20/2011 10:50:47 PM
|
|
|
3 Replies
809 Views
(page loaded in 0.047 seconds)
|
|
|
|
|
|
|
|
|