matlab string to int

To convert a string to an integer in MATLAB, you can use the str2double function. Here's an example:

str = '123';
num = str2double(str);
disp(num);

This will output the integer 123.