data-types()

Programming

data-types() is a MATLAB®-compatible programming function for simlab supports these data types: double — numbers and numeric arrays/matrices (default type) char — strings enclosed in single quotes complex — complex numbers (use i or j suffix, or complex(re, im)) logical — boolean values (true/false, or 1/0) cell — cell arrays that hold mixed types: {1, 'hello', [1 2]} struct — structures with named fields: struct('name', value) symbolic — symbolic math variables (declare with syms) tf/ss/zpk — control system objects (transfer function, state-space, zero-pole-gain) use class(x) to check the type of any value. Run it online in your browser with SimLab — free, no install, no license required.

SimLab supports these data types: double — Numbers and numeric arrays/matrices (default type) char — Strings enclosed in single quotes complex — Complex numbers (use i or j suffix, or complex(re, im)) logical — Boolean values (true/false, or 1/0) cell — Cell arrays that hold mixed types: {1, 'hello', [1 2]} struct — Structures with named fields: struct('name', value) symbolic — Symbolic math variables (declare with syms) tf/ss/zpk — Control system objects (transfer function, state-space, zero-pole-gain) Use class(x) to check the type of any value.

Syntax

42, 3.14, 1e-6          % numbers (double)
[1, 2; 3, 4]             % matrix
'hello'                  % string (char array)
3 + 4i, complex(3, 4)   % complex number
{1, 'a', [1 2]}         % cell array
struct('x', 1, 'y', 2)  % struct
syms x                  % symbolic variable

Examples — run data-types() in your browser

x = 42
▶ Run
A = [1 2 3; 4 5 6]
▶ Run
'hello world'
▶ Run
z = 3 + 4i
▶ Run
c = {1, 'text', [1, 2, 3]}
▶ Run
s = struct('name', 'SimLab', 'version', 2)
▶ Run
syms x y
▶ Run

See Also

Frequently Asked Questions about data-types()

Is the data-types() function free to use in SimLab?

The browser workspace requires no MATLAB® license or installation. Connected features require network access and may have account, tier, availability, or usage limits. You can open data-types() and 510+ other MATLAB®-compatible function references at simulations4all.com/simlab.

Do I need to install MATLAB to use data-types()?

No. SimLab’s core parser, workspace state, and most functions run locally in your browser. The data-types() function requires no MATLAB® license or desktop software download.

What does data-types() do?

SimLab supports these data types: double — Numbers and numeric arrays/matrices (default type) char — Strings enclosed in single quotes complex — Complex numbers (use i or j suffix, or complex(re, im)) logical — Boolean values (true/false, or 1/0) cell — Cell arrays that hold mixed types: {1, 'hello', [1 2]} struct — Structures with named fields: struct('name', value) symbolic — Symbolic math variables (declare with syms) tf/ss/zpk — Control system objects (transfer function, state-space, zero-pole-gain) Use class(x) to check the type of any value. It is a MATLAB®-compatible programming function available in SimLab with the same calling syntax as MATLAB® — typically: 42, 3.14, 1e-6 % numbers (double).

Can I run data-types() in my browser?

Yes. Open SimLab at simulations4all.com/simlab, write or paste code that calls data-types(), and run it. This function’s calculation runs locally in the browser. SimLab session analytics, sharing, feedback, and eligible acceleration have separate network boundaries.

Try SimLab — MATLAB®-compatible, free, in your browser

510+ functions. Runs in your browser. No install. No license.

Open SimLab

MATLAB® is a registered trademark of The MathWorks, Inc. SimLab is an independent project by Simulations4All and is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.