The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Conversion to cell from char is not possible
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 1
Registered: 4/28/13
Conversion to cell from char is not possible
Posted: Apr 6, 2013 7:00 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have a problem with this code:
frequency = zeros(1,1+max_note_distance - min_note_distance);
name = {1,1+max_note_distance - min_note_distance};
base_name = {'C ' 'C#' 'D ' 'D#' 'E ' 'F ' 'F#' 'G ' 'G#' 'A ' 'A#' 'B '};
for halftone_number=-57:39
frequency(halftone_number-min_note_distance+1) = 440*power(2, halftone_number/12);

for octave_number=0:7
for halftone_in_octave=1:12
name(octave_number*12+halftone_in_octave) = sprintf('%s%d', cell2str(base_name(halftone_in_octave)),octave_number);

cell2str function is there:

Matlab gives me the following error message:
Conversion to cell from char is not possible.
It is something wrong with sprintf function i guess. Please help me fix it.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.