Using strings arrays to label an array of changing size

1 次查看(过去 30 天)
Hi guys ^^,
recently I've been using a user defined function by Joao Henriques called disptable and I've come across a problem I thought someone more experienced could help me with.
This program:
Creates a means through which to label any matrix using string arrays or just separators |
I want to label a matrix that varies in size (changes the number of columns) depending on initial values. i.e the following matrix:
[1 2 3 4 5 6] Becomes [1 2 3 4] as initial conditions state the last two elements are no longer needed.
Is there a way to use the aforementioned program in such a way that a string array:
'Dip 1' 'Dip 2' 'Dip 3' 'Dip 4' Becomes Dip 1 Dip 2 Dip 3
if necessary?
I know this is more for aesthetic purposes and I could just simply make a label 'No. of Dip' and place it on top of a column array 1 2 3 4 etc... but is it possible to do this using the above function?
I tried this way
>>disptable(exmplematrix,'S','A|B|C|D')
Where S is a string matrix defined like so:
S={'D1' 'D2 'D3' 'D4'} S= 'D1' 'D2' 'D3' 'D4'
But whenever I try it says:
??? Undefined function or method 'iscellarray' for input arguments of type 'cell'.
Has that specific matlab command been changed/updated since this program was made?
Again, thanks for the help in advance ^^,

采纳的回答

Image Analyst
Image Analyst 2012-2-11
I think that iscellarray is either a function that he didn't include, or it was a MATLAB function that was deprecated (made obsolete and slated for removal in some unspecified future version), or else it's in a Toolbox that you don't have.
  1 个评论
Don  Isiko
Don Isiko 2012-2-11
Hi ^^ thanks! I realised that "iscellarray" has been replaced with the seemingly more recent "iscellstr" , plugged this into the function and shazzam! It worked beautifully (; thank you again for the help!

请先登录,再进行评论。

更多回答(1 个)

Don  Isiko
Don Isiko 2012-2-11
Hi ^^ thanks! I realised that "iscellarray" has been replaced with the seemingly more recent "iscellstr" , plugged this into the function and shazzam! It worked beautifully (; thank you again for the help!

类别

Help CenterFile Exchange 中查找有关 Axis Labels 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by