LoginSignup
0
0

More than 5 years have passed since last update.

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

Posted at

超ニッチですが,手っ取り早く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))みたいな感じで使えます.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0