Matlab Error: Function is not defined for 'cell' inputs

后端 未结 1 1450
予麋鹿
予麋鹿 2020-12-21 17:28
fid = fopen(\'./tickers.tex\', \'wt+\');
for x = 1 : size(C.names,1) 
    fprintf(fid, \'%s & \', C.names(x,1:end-1)); 
    fprintf(fid, \'%s \\\\\\\\ \\t\\n\',          


        
相关标签:
1条回答
  • 2020-12-21 17:38

    Ok from the error and code you have I am assuming C is an array of cells and you want to print some string from each entry of C. Assuming this, your code is incorrect. Try this:

    fid = fopen('./tickers.tex', 'wt+');
    for x = 1 : size(C,1) 
        fprintf(fid, '%s & ', C{x}.names(1:end-1)); 
        fprintf(fid, '%s \\\\ \t\n', C{x}.names(end)); 
    end 
    fclose(fid);
    

    Is this what you want? If not please provide more information about C

    0 讨论(0)
提交回复
热议问题