Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help with MATLAB graphics

  1. May 14, 2012 #1
    Hello! I'm trying to make an easy MATLAB programme in which you can plot your graphs, change the linewidth, and linestyle in the graphs you want etc.
    I've managed to use to dialog windows in matlab and write a loop which plots a given function. Now I want the programme to ask the user for the figureid and the linewidth and then make the corresponding change.. Here I run into trouble.

    My code for this specific m-file is:

    Code (Text):
    function outt = changewidth(handles)  

    Figureid = input('Which figure would you like to change: ');
    Width = input('Which width would you like to have: ','s');

    z = str2num('Figureid');
    p = str2num('Width');

    set(z, 'Linewidth', p);

    I dont get any error message but matlab wont update the graph that the user refers to..

    Any advice?
  2. jcsd
  3. May 14, 2012 #2
    In my mainfile I just write:

    Code (Text):

    case 2


    case 3

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook