0 down vote favorite(adsbygoogle = window.adsbygoogle || []).push({});

share [g+] share [fb] share [tw]

Hi...I'm the beginner. I want to ask, how to put edit text to matrix? For example,

I have 30 edit text that will fill by number 0 - 1.

I want to make matrix x(1,1),....x(1,30) from the input of edit text.

I have tried this code :

function edit1_Callback(hObject, eventdata, handles)

% hObject handle to edit1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text

% str2double(get(hObject,'String')) returns contents of edit1 as a double

x(1, 1) = str2double(get(hObject,'string'))

till....

function edit30_Callback(hObject, eventdata, handles)

% hObject handle to edit30 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit30 as text

% str2double(get(hObject,'String')) returns contents of edit30 as a double

x(1, 30) = str2double(get(hObject,'string'))

but, the command window show like this...

x =

1

x =

0 0

x =

0 0 0

x =

0 0 0 0.2500

x =

0 0 0 0 0.5000

x =

0 0 0 0 0 0

but actually I want the result is matrix, like

1 0 0 0.25 0.5 0

Does anyone know how to solve this problem?

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB GUI Edit text to Matrix

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for MATLAB Edit text |
---|

MATLAB MATLAB: forces acting on an object |

MATLAB Matlab histogram |

MATLAB Sovling Bernoulli's differential equation in matlab? |

MATLAB Matlab-like software |

MATLAB Matlab data into bins |

**Physics Forums | Science Articles, Homework Help, Discussion**