Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

conversion from double to integers

Status
Not open for further replies.

Aeroing

Aerospace
Apr 29, 2003
8
I have built a GUI, where I take numerical values from a text box to calculata something afterwards. For this I used this command: x = str2double(get(handles.edit1,'String'))
When I give these numbers as parameters to a function [a,b]=myfunction(x) this warning appears:
Warning: Subscript indices must be integer values.

What do I have to do? With which command can I transform these noumbers into the correct format for myfunction. I have already tried int32 and replaced
x = str2double(get(handles.edit1,'String'))
by
x = str2num(get(handles.edit1,'String'))
but the warning is still there. I will be grateful for every help.
Bye
Aeroing
 
Replies continue below

Recommended for you

Maybe this will help

x = int32(str2num(get(handles.edit1,'String')))

These conversion functions are also available: int8, int16 and int64.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor