Using strings arrays to label an array of changing size

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일

0 개 추천

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

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일

0 개 추천

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!

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by