Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8649337
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:32:08+00:00 2026-06-12T13:32:08+00:00

I am trying to combine values from several UI controls in order to select

  • 0

I am trying to combine values from several UI controls in order to select a particular graph output. Here’s the code:

First we open the figure:

figure('position',[100 100 700 350]);

Part 1: The Popup UI control input value:

pullDown = uicontrol('style','popup',...
            'position',[10 680 180 10],...
            'string','Displacement|Velocity|Acceleration',...
            'callback',@function1); 

Part 2: The radiobutton UI control:

radioButtonGroup = uibuttongroup('visible','off',...
            'units','pixels','position',[0 0 1 2],'backgroundcolor','white');
        radio1 = uicontrol('Style','radiobutton','String','Computed',...
            'position',[250 20 100 30],'parent',radioButtonGroup);
        radio2 = uicontrol('Style','radiobutton','String','Recorded',...
            'position',[400 20 100 30],'parent',radioButtonGroup);

So, what I’m trying to do is maybe write an if-elseif that could help me do something like this (I’m just going to write in pseudocode):

if pullDown == 'Displacement' AND radio == 'Computed'
   plot(graph1,x);
else if pullDown == 'Displacement' AND radio = 'Recorded'
   plot(graph2,x);
...

and so on. Any ideas?

Thanks in advance!

NAX

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:32:09+00:00Added an answer on June 12, 2026 at 1:32 pm

    You gotta do something along these lines:

    For the radiobutton group, use a ‘SelectionChangeFcn’ .You can use the selection on the radiobutton to choose the plot you want to display(here is how: at the end of radioButtonGroup definition, add ‘SelectionChangeFcn’,@plotComputedOrRecorded):

    function plotComputedOrRecorded(source,eventdata)
        switch get(eventdata.NewValue,'String')
            quantity = QuantityStrs{get(pullDown,'value')};
                 %QuantityStrs = {'Displacement','Velocity','Acceleration'}
            case 'Computed'
                plotComputed(quantity);
            case 'Recorded'
                plotRecorded(quantity);
        end
    end
    

    You can then use two functions @plotComputed and @plotRecorded to plot the relevant quantities in the appropriate axis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to combine multiple column values into 1 and then label them distinctly
I'm trying to combine a static hard coded string with one referenced from strings.xml
I'm trying to build a safe user authentication system. The code is from http://net.tutsplus.com/tutorials/php/simple-techniques-to-lock-down-your-website/
I'm trying to combine an insert sql statement with a select statement, I successfully
I am trying to figure out how o combine jQuery code, where I grab
I'm trying to create a single query containing optional aggregate values from multiple tables
I'm trying to combine the codes from these two questions: using jQuery to slideToggle
I have two questions. First: I am trying to combine two queries into one
im trying to combine two images into a single image. unfortunately this has to
I'm trying to combine both the result of a semantic and a dictation request

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.