Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

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


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

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

Advanced Search

Back to Topic List Back to Topic List  
Katarzyna

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

Hi,
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);
end;

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

cell2str function is there:
http://www.mathworks.com/matlabcentral/fileexchange/3369-techniques-of-model-based-control/content/cell2str.m

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]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.