Using strings arrays to label an array of changing size
Afficher commentaires plus anciens
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 ^^,
Réponse acceptée
Plus de réponses (1)
Don Isiko
le 11 Fév 2012
0 votes
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!