Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to find type of a variable?

Subject: How to find type of a variable?

From: Yaroslav Bulatov

Date: 26 Jun, 2009 21:10:02

Message: 1 of 7

Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?

Subject: How to find type of a variable?

From: Nathan

Date: 26 Jun, 2009 21:13:14

Message: 2 of 7

On Jun 26, 2:10 pm, "Yaroslav Bulatov" <yarosla...@gmail.com> wrote:
> Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?

Try:
whos name_of_variable

Hope that helps
-Nathan

Subject: How to find type of a variable?

From: Loren Shure

Date: 29 Jun, 2009 11:15:55

Message: 3 of 7

In article <h23dfa$bb3$1@fred.mathworks.com>, yaroslavvb@gmail.com
says...
> Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?
>

Is the function class what you are looking for?

--
Loren
http://blogs.mathworks.com/loren

Subject: How to find type of a variable?

From: Saidul Hasnan

Date: 11 Jul, 2009 19:53:03

Message: 4 of 7

"Yaroslav Bulatov" <yaroslavvb@gmail.com> wrote in message <h23dfa$bb3$1@fred.mathworks.com>...
> Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?

help isa

Regards,
Saidul

Subject: How to find type of a variable?

From: Loren Shure

Date: 12 Jul, 2009 07:35:39

Message: 5 of 7

In article <h3aqiv$8qc$1@fred.mathworks.com>, zero_ace@yahoo.com says...
> "Yaroslav Bulatov" <yaroslavvb@gmail.com> wrote in message <h23dfa$bb3$1@fred.mathworks.com>...
> > Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?
>
> help isa
>
> Regards,
> Saidul
>

Use the function "class".

--
Loren
http://blogs.mathworks.com/loren

Subject: How to find type of a variable?

From: Muhammad

Date: 30 Jun, 2013 22:37:09

Message: 6 of 7

"Yaroslav Bulatov" <yaroslavvb@gmail.com> wrote in message <h23dfa$bb3$1@fred.mathworks.com>...
> Workspace window doesn't always give type of variables...is there a command to find out type of a given symbol?
You can use the following example :

 b = 2
b =
     2
>> a = 'Hi'
a =
Hi
>> class(b)
ans =
double
>> class(a)
ans =
char

Subject: How to find type of a variable?

From: dpb

Date: 30 Jun, 2013 23:37:46

Message: 7 of 7

On 6/30/2013 5:37 PM, Muhammad wrote:
> "Yaroslav Bulatov" <yaroslavvb@gmail.com> wrote in message
> <h23dfa$bb3$1@fred.mathworks.com>...
>> Workspace window doesn't always give type of variables...is there a
>> command to find out type of a given symbol?
> You can use the following example :
>
> b = 2
> b =
> 2
>>> a = 'Hi'
> a =
> Hi
>>> class(b)
> ans =
> double
>>> class(a)
> ans =
> char

See also

doc whos
doc isa

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us