如何在MATLAB中知道变量的大小 [英] How to know the size of a variable in MATLAB

查看:1260
本文介绍了如何在MATLAB中知道变量的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MATLAB中有变量,我已经使用class()检查了它们的类,但我也想知道它们在内存中的大小.更准确地说,我知道它们是double类型的,并且我想确保它们是32位double而不是64位.

I have variables in MATLAB, I've checked their class using class() but I also want to know the size that they take in the memory. More accurately, I know that they are of double type, and I want to make sure that they are 32-bit double and not 64-bit.

我正在使用的MATLAB版本是R2009b.

The version of the MATLAB I'm using is R2009b.

推荐答案

您可以使用获得一组结构数组,这些结构除其他外描述了每个变量的字节大小.

You can use whos to obtain an array of structures that describe, amongst other things, the size in bytes of each variable.

请注意,根据定义,double是64位!

Note that a double is, by definition, 64-bit!

这篇关于如何在MATLAB中知道变量的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆