Using strings arrays to label an array of changing size

4 views (last 30 days)
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 ^^,

Accepted Answer

Image Analyst
Image Analyst on 11 Feb 2012
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 Comment
Don  Isiko
Don Isiko on 11 Feb 2012
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!

Sign in to comment.

More Answers (1)

Don  Isiko
Don Isiko on 11 Feb 2012
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!

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!