admin 管理员组文章数量: 888297
matlab maximum,maximum size of a string in matlab
问题
I am a newbie at matlab and I am trying to solve the following scenario.
I have large strings which need to be xor'ed essentially encoded in order to get a value.
I am using the following code snippet to perform the operation :
clear;clc;
first ='abceeeeeeeeeeeeeeeddddddddddddd';
second='defrrrrrrrrrrrrttttttttttttuuuu';
result=bitxor(uint8(double(first)) , uint8(double(second)));
In the code above I am hard coding the value of the strings. I was wondering if matlab defines a size limit on the strings? If someone could help me to understand this value more in terms of bytes it will be very helpful.
Thanks and Regards,
Bhavya
回答1:
I don't think tere is a size limit attached to the variable, but there is certainly a limit in term of available memory which depends on your operating system and computer architecture.
For example, I run Matlab R2008b on a 32 bits Windows 7. The output of the command memory gives me:
Maximum possible array: 1128 MB (1.183e+009 bytes) *
Memory available for all arrays: 1470 MB (1.542e+009 bytes) **
Memory used by MATLAB: 294 MB (3.085e+008 bytes)
Physical Memory (RAM): 3519 MB (3.690e+009 bytes)
* Limited by contiguous virtual address space available.
** Limited by virtual address space available.
I can create a character array of 5e8 elements before I raise an "out of memory" error, so that is 1e9 bytes, which is in agreement with the memory output.
You can check out the technical notes related to memory management on the MathWorks website:
Maximum Matrix Size by Platform
Memory Management Guide
Avoiding 'Out of Memory' Errors
来源:
本文标签: matlab maximum maximum size of a string in matlab
版权声明:本文标题:matlab maximum,maximum size of a string in matlab 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1693586006h230769.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论