how to know what type of dataset you have?

3 vues (au cours des 30 derniers jours)
Gurvinder
Gurvinder le 15 Août 2013
Hi I am new to MATLAB and programming in general and get confused across knowing what type of data sets i have i.e cell array matrix numeric int etc as sometimes when creating.
I know there are various functions like iscell(x) to find out the details of if its a cell etc but is there and easier way to test this. For example a generic command in which you would have is???(x) and it will pop out and tell you exactly what type of data set you have. I ask this as most my confusion and errors at the moment come because i don't know what i have created all the time and spend ages trying to find out what i have and convert it to whats needed.
can someone tell me the difference between a cell and matrix?
sorry for basic stupid questions but just like to build up my knowledge base....also a link to detailed documentation would be good also.
Thanks in advance.

Réponse acceptée

Jan
Jan le 15 Août 2013
Are you looking for the class command?
a = cell(1, 3)
b = 1:3
class(a)
class(b)
A matrix consists of scalar elements, which all have the same type. But a cell can contain elements of different types and they can have different sizes also:
A = [1, 2, 3; 4, 5, 6];
C = {1, [1,2], 'Hello', {'A nested cell'}}
  1 commentaire
Gurvinder
Gurvinder le 16 Août 2013
Fantastic, thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Aucun tag saisi pour le moment.

Community Treasure Hunt

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

Start Hunting!

Translated by