MATLAB: How to multiply an integer with a single value from the matrix

cell arraysMATLABmatrix arraymatrix manipulation

%Start of the code
Module_Information = inputdlg ({'Thrust','Mixture Ratio','Reserve'},'Test', [1 50; 1 50; 1 50;]);
Exhaust_Veloctiy = 4 * Module_Information(1,1)
%End of the code
How do I extract "Moduel_Information(1,1)" or the "Thrust" and multiple with a integator, such as 4.

Best Answer

  • You need to convert the character vector (contained in the output) into numeric, e.g.:
    C = inputdlg(...); % C is a cell array of character vectors!
    N = str2double(C{1}) % N is numeric!
    N*4