Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Apr 29, 2003
Messages
8
Location
FR
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
 
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

Back
Top