How to force my output data in a inputdlg on Matlab be a double?

452 views Asked by At

I'm currently using a MATLAB to work and I need some help:

I need to convert my output data (variable: units) be a double instead of a cell because I must perform a sum:

units = inputdlg(question,title);
sum = units + i;

I've tried this code also but didn't solve my problem:

units = double(inputdlg(question,title));
sum = units + i;

Someone could help me?

1

There are 1 answers

0
Luis Mendo On BEST ANSWER

inputdlg returns a cell array of strings. You can convert to double with str2double:

units = str2double(inputdlg(question, title));