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

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Help MATLAB graphics Date
Matlab MATLab: Not enough inputs for nlinfit Nov 16, 2017
Matlab Help needed to fix a matlab code Nov 8, 2017
New to Matlab, help with vectors Feb 20, 2016
Need help with integral Dec 23, 2015
Communication between Arduino and Matlab Help Jun 19, 2015