Max line size in matlab

I am new to Matlab and I am trying to solve the following scenario.

I have large strings that need to be encoded mainly for encoding in order to get the value. To perform the operation, I use the following code fragment:

clear;clc; first ='abceeeeeeeeeeeeeeeddddddddddddd'; second='defrrrrrrrrrrrrttttttttttttuuuu'; result=bitxor(uint8(double(first)) , uint8(double(second))); 

In the above code, I hardcode the string value. I was wondering if Matlab defines a string size limit? If someone can help me understand this value more in terms of bytes, it will be very helpful.

Thanks and Regards, Bhavya

+4
source share
1 answer

I don’t think tere is the size limit associated with a variable, but there is certainly a limit to the available memory, which depends on your operating system and computer architecture.

For example, I run Matlab R2008b on 32-bit Windows 7. The output of the memory command 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 an array of characters from 5e8 elements before I raise an "out of memory" error, so this is 1e9 bytes, which is consistent with the memory output.

You can check the technical notes related to memory management on the MathWorks website:

+4
source

Source: https://habr.com/ru/post/1391398/


All Articles