Help us understand the problem. What is going on with this article?

数列をcell(各要素はstr)に分解する

More than 5 years have passed since last update.

超ニッチですが,手っ取り早くlegendを振りたいときなどに便利です.

num2strcell.m
function [ out ] = num2strcell( numseq )

out=cellfun(@mat2str, mat2cell(numseq,1,ones(1,length(numseq))),'UniformOutput', false);

end
>> num2strcell(1:5)

ans = 

    '1'    '2'    '3'    '4'    '5'

legend(num2strcell(1:number_of_plots))みたいな感じで使えます.

jellied_unagi
Python and Matlab tips for computer vision
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away