MATLAB Answers

0

Matlab Gui Column Calculation Problems adds 48

Asked by Tolulope Abiola on 24 Aug 2019 at 14:48
Latest activity Edited by Bruno Luong
on 24 Aug 2019 at 15:16
Hello, please i need help as am trying to make some column calculations in matlab gui.
dataC = get(handles.uitable1, 'Data'); Data = cell2mat(dataC(:,1)); C = 2* Data(:,1) * pi; dataC(:,3) = num2cell(C(:,1)); set(handles.uitable1, 'Data', dataC)
With this code it adds 48 to each digit input before performing the task. And when two digits number is entered like 56 it only calculate for 5 which is the first figure alone. Anyone please help out.

  0 Comments

Sign in to comment.

1 Answer

Answer by Bruno Luong
on 24 Aug 2019 at 15:14
Edited by Bruno Luong
on 24 Aug 2019 at 15:16
 Accepted Answer

Convert your GUI Data input using str2double, str2num etc
>> str2double('0')+1
ans =
1
>> '0'+1
ans =
49

  0 Comments

Sign in to comment.