×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

conversion from double to integers

conversion from double to integers

conversion from double to integers

(OP)
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

RE: conversion from double to integers

Maybe this will help

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

These conversion functions are also available: int8, int16 and int64.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources